Countries can agree to arbitration. As you mentioned Ukraine, they did agree something like with Romania... over Snake Island and the surrounding EEZ.
I can't think of anyI can't think of any examples where countries agreed to that after going to war over said territories, though. (N.B. some examples where countries agreed to that after going to war over said territorieswould qualify for the latter category are the 1968 "Rann of Kutch arbitration" which did settle some border demarcation matters beween India and Pakistan, thoughalthough it hardly prevented later armed conflicts between the two countries on other/related matters. And another would be the 1988 "Taba arbitration" regarding the border on the Sinai peninsula that had been left unresolved by the 1979 Egypt-Israel peace treaty proper.)
In any case, it's extremely unlikely Putin's government and Zelenski's would come to such an arbitration agreement. Most likely Ukraine's policy will be influenced by whatever support it's getting (or lack thereof) from the West. Back in the days of the Minsk agreements, Germany and France were quite interested in the fighting to stop (even if that meant Ukraine making fairly big concessions). And the US didn't care much about the region.