They starve and die, likely becoming caniballistic or committing suicide, escape through damaged portions of the prison, or the employees unlock the doors upon fleeing. Not a way to tell, as all prison keepers will flee to their families in the event of a nuclear war. The question remaining would only be as follows: Does the prison guard unlock the doors in the prison upon his departure.
There were US and Allied POWs at bother Hiroshima and Nagasaki, not one of them became a cannibal, not one committed suicide, few of them were actually locked up at the time of the attacks. Of those that were, some were killed by fires that consumed the buildings where they were held, others were released. Of those at Hiroshima, a few died from the blast, several were stoned to death by irate Japanese citizens.
In the aftermath of the two bombings, there are no reported cases of cannibalism amongst the civilian populace. It is likely that some Japanese did commit suicide. As for the aftermath of the bomb, if you will notice, Hiroshima, Nagaski, and even Japan, continue to exist today. So much for the end of the world