I guess it depends on how gritty your campaign is. I can see hung from the neck until dead as a possible outcome here, although I'd assume you want to avoid a TPK.
In my campaign, the most likely outcome is that they would become toys of some secret faction way above their current weight class with an unrevealed agenda who would arrange for them to be 'released from custody' through bribery, forgery, and/or charm spells and then force them to do skullduggery for them in the role of expendable slave.
Scenario #1: Whoever is capable of putting the PC's into a donjon against there will is probably more than capable of keeping them there. In a world filled with magic and superheroes, they won't be the first mighty individuals to be thrown in a lock up. Someone will know how to take care of them. Escape is going to require extreme creativity because anything obvious that they think up is certainly going to be such a common ploy that the guild of gaolers/executioners/tortorurers/whatever have had thwarting it as part of their art for thousands of years, and any such attempts will just amuse them. It will turn out a betting pool has been set up as to what sort of trick they will try first. I consider this the most likely scenario, based on what you describe.
My solution here would be to make them sweat it for a few hours describing their incarceration, sentencing, etc. and see if they can surprise you. If they can't, let them rot in jail for a few weeks game time and then bring on the deus ex machina.
Variant A: Their liberators are villains, although that may not be clear from the start given the layers of deciet and intrigue. The trick here will be surviving long enough in the hands of ruthless bad guys who have more or less complete control over their lives, knowing that they can't go back to the good guys for help, until such time as they can turn the tables on the villains, spoil their plans, and win for themselves a repreive from the grateful rulers.
Variant B: The liberators look just like those in Variant A, but gradually it will become clear that the liberators just look like villains and in fact the real bad guys were the ones that they thought were good guys.
Variant C: The liberators claim to be representatives of the higher powers of good, and oddly enough, this claim turns out to be true. Such honesty and openness is rare in the world, especially when dealing with covert organizations. The twist is that there is no twist. This is a conveinent way to push the characters toward one of the world's larger story arcs.
Scenario #2: The people who locked them up thought they were average commoners. They didn't know who or what they were dealing with, and so haven't taken adequate precautions. As a result, security is shoddy compared to the character's abilities. This sounds like what you want, but this is likely to only be true if the characters are fairly high level and either choose not to resist (because of a moral imperative) or else were taken by complete surprise. In particular, if they aren't high level escape is likely to take game weeks, months, or years of time to plan and arrange as the players slowly scrounge items and craft suitable tools. If this isn't what you want, then have someone higher level in the prison organizing an escape (alla 'The Count of Monte Cristo') and include them in their plans, or else have their be a prison riot or a mass breakout as a scenario adventure. Keep in mind that breaking out in this situation by any means is not likely to be the end of the PC's troubles, as they will now be seen as more dangerous trouble makers and worth spending more resources on capturing and detaining.
If you want to spend significant time on the characters in prison, I suggest you study ancient prisons and customs so as to not make the mistake of treating the situation exactly like the modern one. The PC's may have surprising resources - loved ones on the outside, the ability to pay for better accomodations or better treatment might not even be considered a bribe, the ability to ransom themselves, etc.
Scenario #3: Out of the frying pan and into the fire. One of the problems with scenario #2 is that if you are breaking out of prison controlled by the good guys, its really hard to do so and not harm the innocent. If your PC's are all persons of high integrity, it may be particularly hard for them to escape and maintain character. One solution in this case is to move the character's somewhere less savory by some device. One possibility is for them to be put in a work detail, and from there to be captured by a warband of evil humanoids. Another possibility is to be transferred to another facility where the warden turns out to be mad or a member of a evil cult or to run an illegal pit fighting scheme. A third possibility if your society supports slavery is to have them legally sold into bondage. Their new owner might be either much more cruel or else much more sympathetic.