It's too early to make predictions on how this will evolve, and what will benefit Ukraine the most, long term. Taliban initially lost in Afghanistan, however, 20 years later they won the country back. NOT the same situation in Ukraine but it still illustrates how difficult it is to make predictions, especially about the future, and it also illustrates the importance of will to fight an intruder, and how one can win the war even if a number of battles are lost, again and again.
Economy remains key. The West won the cold war without firing a shot (against the USSR), still, the USSR collapsed in the end. So the outcome may not be decided on the battlefield.
Ukraine can still win if we keep supporting Ukraine until either Russia pulls out, or Russia collapses just like the USSR collapsed.