Two words, guerrilla war.
As Russia maintains the pressure, Ukraine trains citizen-soldiers for guerrilla warfare
The problem with your question is that you assume that the war would end if Ukraine became a landlocked state, I would say that could never happen. Putin has to take all or none of Ukraine, because peace talks can never happen again, because of the war crimes that have been committed. But let us just assume that somehow happened, as I have said, a guerrilla war would start.
The parts of Ukraine that stood free would still fight, no matter if the government said to stop. A guerrilla war would start in the occupied part, and would only stop with Putin leaving Ukraine. I read somewhere that if Russia somehow took Ukraine, it would be Afghanistan 2.0 times 10! There is no way Putin can take Ukraine, and keep it. So, as always,
Have a Skittlely good day and Slava Ukraine