There should be a command for automatically balancing the Guard:Prisoner ratio. This could be done effectively by having it kick the guards who have been on that team the longest until the ratio is balanced, however that might be almost impossible because it means you would have to also track the amount of time people spend on the guard team. It would be the best compromise of ease, and usability, to make it so it kicks guards off the team at random until the ratio is in balance.
TL;DR
There is a problem with guards not getting sorted off the team when the balance is upset.