Russia has already lost the war they prepared for and hoped to fight. Too many people confuse the Russian capabilities today, with those of the old USSR, which had the best forces, munitions and other equipment from a number of subordinate countries. They still have nukes, but their conventional capabilities have been exposed as not quite top notch.
Ukraine will not march into Moscow. Their attention for the next decade will be restoring the civilian infrastructure destroyed by Putin. But they are in a strong position to negotiate a total withdrawal of Russia's forces from their territory. They might even be able to get token reparations.
Putin, if he lives much longer, and his top deputies, et. al, face War Crime charges. Whether they will surrender to face those charges is completely another story.
Germany did negotiate an end to hostilities, after they lost on the battlefield.