One of the problems for Russia is that they've been launching just incredible amounts of cyberattacks against Ukraine since 2014. For example a record setting DDOS in 2014, significant portions of their power grid were disrupted in 2015 and then again in 2016. That taught and the reinforced some harsh lessons for Ukraine over the many years since then. Given that, despite notable exceptions like Solarwinds, most cyberwarfare is heavily facilitated by a lack of security education, laziness and cheapness, it gave Ukraine a lot of time and motivation to make the changes necessary to really harden their environments. Part of the reason we see so many breaches in the US is that IT Security is more of a cost center than regular IT and is just downright inconvenient. So education efforts stall or are small in scale, those servers and computers stay unpatched or unsupported and that software remains in the environment because it would be too expensive or disruptive to revenue to do otherwise. (Although the US government has really been stepping up their requirements (New NIST and CMMC) along with more resources from the FBI and CISA to help)
The invasion also stripped a lot of the protections and revenue streams Russian groups were afforded as Western countries were trying to maintain more cordial relationships with Russia. If you don't have companies operating in Russia and your citizens aren't heating their homes with Russian gas you start caring a lot less what Russia thinks about you more aggressively targeting hackers operating out of Russia. I have no doubt Ukraine has also been inviting a lot of partnerships with governments and leading security firms to help with mutual benefits all around.
Going forward I suspect the brain drain in Russia is really going to hamper their ability to operate in this space esp when you juxtapose it with the US which really picked up its focus and investments in cyber security. They'd probably need to spend a lot more to retain or get talent and I doubt we're going back to playing on the tilted field we were on prior to the invasion