RED:
SCOUT: Has the speed necessary to escape with relative ease, but fighting BLUs with melee only is challenging because most of his melees tend to have weak damage output. Once he gets ammo he can rebel pretty efficiently.
SOLDIER: Rather slow and thus easy to pick off unless he has the Escape Plan equipped. But should he get ammo he can do pretty well.
PYRO: Average speed to escape. Should a Pyro get ammo, they have to rely more on surprise attack tactics than others do to their primary weapon being close-range.
DEMOMAN: Slow to escape but have good melee options unlike other classes. Once they get ammo they can truly be a force to be reckoned with due to their immense ability to set surprise stickybomb traps.
HEAVY: Very slow, making it hard to escape. If he gets ammo, he can be immensely deadly when close up. And of course, many a Heavy will attempt to use their long range tauntkill to surprise the BLU team.
ENGINEER: Moderately good at escaping due to average speed. The Eureka Effect can allow him to escape in a unique way unlike others by transporting him back to cells, but because the cells are often closed, this makes it extremely difficult, sometimes borderline impossible, for the Engineer to escape unless he ends up in a cell with a breakable exit. Has the second-lowest rebelling potential behind Medic due to average weapons.
MEDIC: Can escape fairly decently with their above-average speed, helped by their self-autoheal. However, has the lowest rebelling potential on his own due to his below-average primaries (excluding the Crusader's Crossbow). His greatest strength often lies in helping other rebellers by providing them with a source of healing and Ubercharge.
SNIPER: Has moderate escaping abilities with average speed. Once he gets ammo however, Snipers can easily become the bane of any BLU, especially on maps with wide open spaces and little cover. He is easily the most dangerous class with ammo. The most dangerous class WITHOUT ammo, however, goes to...
SPY: Has the ability to backstab. Enough said. Besides having above-average speed allowing for well-executed escapes, his ability to sweep in and trickstab makes him borderline overpowered in a lot of cases. Although getting ammo gives him even more of an edge, it actually fairly pales in comparison to his backstabbing ability. He is probably the only class that absolutely excels at rebelling even without ammo besides possibly Demomen.
BLU:
SCOUT: Great at hunting rebellers due to their fast speed. Provided they can get close up without putting themselves in too much danger, they also have good damage output.
SOLDIER: Potentially rewarding but VERY risky class to use on BLU. Best at hunting isolated rebellers, as trying to kill a rebeller hiding in a group will almost invariably lead to trouble. Too many mass freekills occur regularly because of the Soldier.
PYRO: Another risky class to use on BLU. Another class that's too easy to accidentally mass freekill with due to the flamethrower's range up close, and not the best at hunting rebellers due to a lack of very good long-range weapons (his shotguns and flare guns are decent at best).
DEMOMAN: Same camp as Soldier, best at hunting isolated rebellers. Placing stickybombs in a group of REDs will ALWAYS lead to trouble.
HEAVY: Super slow class that has the potential to mow down rebellers up close, but most can easily run away from him.
ENGINEER: One of the safer but less powerful classes to use to control prisoners.
MEDIC: Has low rebeller-hunting potential, best when helping other BLUs hunt rebellers or when helping the warden (via healing).
SNIPER: Long-range sniping abilities make him an excellent choice for killing rebellers. Provided he's careful, one can even pick out rebellers hiding within a group (unless he's using the Machina).
SPY: Low rebeller-hunting potential with his primary and usually too risky to attempt backstabs on rebellers.