Either scenario is unlikely. Russia will have to give up some of its war aims, which now mainly seem to be reduced to keeping the parts of Kherson, Zaporizhia, Donetsk and Luhansk it has grabbed since Feb 22 as well as Crimea. Ukraine will have to give up its goal of re-taking all of its pre-2014 territory. What's going on now are the battles to determine where the line will be drawn. Russia should get pushed back to approximately its Feb 22 lines so it gains nothing from its current war but gets recognition of its 2014 annexations. Ukraine gets real security guarantees and entrance to the EU.
The thing is “real security for Ukraine” is difficult as long as Russia says
1. Ukraine is an illegitimate country
2. Ukraine should be assimilated into Russia
3. All Ukrainians are Nazis as they don’t want to be ruled by the Kremlin