It is possible to include certain guarantees within a treaty to make it painful for either side to break it, or to make breaking it extremely difficult. That’s what Ukraine would have to demand from Russia - some kind of leverage or collateral to guarantee the peace holds.