There's plenty of barbed wire on top of the walls and fences to keep jumpers out.

A prison isn't meant to keep something in or keep something out, but to isolate. It's perfect once you got rid of the prisoners.
However, that'll be pretty hard depending on the situation.

Maybe, the people at the prison (including guards) aren't infected yet. Then you'll have a pretty darn hard time to fortify the position, unless you can convince the warden about the zombies.
Another possibility is that it's totally deserted, which will make it hard to find out where the controls for the gates are (which, by the way, will stop working when the power is down. Gotta prepare for that!), or that everyone (including guards) is already infected.

Either way, manual defenses are safer than ones that rely on power. Especially on the long term. You can't fuel that generator (you might not even ever have) forever!