You can definitely win war by defending. That's how WW1 played out in France : Verdun, La Somme, etc were all played on French territory, and bled out the German army. Then there was some attacking, but you could imagine that if Ukrainians wreck all attacking Russians in their territory it would be easy for them to push until Russia asks for peace. (But I don't think even full-fledge European help, offense included or not, could help Ukraine achieve that)