Due to the cost of having a static anti-magic field, such prisons are going to be super high security and pretty much exclusively for powerful spellcasting criminals. We're all level one. For lower end casters, taking away their spellbook / familiar / holy symbol will pretty much clip most of what magic they can do, and individuals who are a problem beyond that can be handled by simply waking them up after about five hours of sleep, having them jog a distance to wake up, then send them back to sleep for the rest of the night- interrupting their rest like that would mean they couldn't prepare spells.
Fact is if we're on a chain gang, then we're clearly not considered the super dangerous casters who require and antimagic field, they're letting us out enough to work on roads and handle tools and such. As such, some level of plan could be made that does involve magic, especially if us clerics don't draw enough attention to ourselves that they realize we actually are casters / make them need to stop us from preparing spells. Sujurak could pretty easily pass for a thug of some sort, and it's entirely possible that they don't even realize that he's a spellcaster and not just some superstitious brute who likes to carve little totems out of scraps of wood- not realizing that such totems constitute his holy symbol. I don't know what your necromancer's holy symbol is or why he was imprisoned, but it could be a similar thing.
EDIT:
Just reviewed how prepping spells works in Pathfinder, apparently resting doesn't influence it, but clerics need to pray for an hour to prepare their spells, and that would be easy to train guards to spot and interrupt. It would likely come down to setting things up so that we could get an hour to prep spells, since once we do that we have a lot of options.