There's no way this will end with a total victory for either side. Neither Russia nor Ukraine will give in to all of the other's demands.
The only way out of this is to give Putin a face-saving option that he can repackage as a win - but one that's also mutually beneficial for Ukraine and the West.
Expecting Putin to withdraw forces and admit defeat is unrealistic because he has nothing left to lose right now. And expecting Ukraine to willingly end ambitions of joining the ranks of western Europe are also unrealistic because too much water has passed under the bridge.
The best solution to this mess is for Ukraine's EU application to be rejected, but with promises of non-military trade deals and greater western economic investment. That way, both leaders can have a symbolic victory (although Ukraine's will be much more concrete).
Given that Ukraine seems unlikely to lose at this stage of the war, some kind of pretence to a two-way agreement is the only way to prevent Putin using nukes. As distasteful as it might be to make him look good on some level, saving lives should be the priority.
It wouldn't surprise me if Zelenskyy wrote that application precisely because he knew it would get rejected. It's not like Ukraine meet all of the requirements for EU membership anyway.