You mean the one trapped in the west? Phantaria's capital is in the west so he must try to rush his way to the east coast and then set sail without being captured again.
Actually, I put an exception in for this kind of case.
When you're released from prison and your realm does not control its capital, you will be treated the same as a rogue who is released from prison, and get to choose a new realm to join.
This will also act as an extra incentive not to lose your capital in war.