I'm having problems with rescuing my companions from prison as well.
I was neutral, taking on the quest where I had to either kidnap or persuade 2 lords to agree to peace. I failed my persuasion attempts on one, so I attacked him and was wiped out. I later talked to a traveler and found out that my companions were in jail, so I traveled to the now hostile town, snuck in, bribed the jail guard, and went into the prison. Thankfully, this prison did not have the bars that others are talking about, so I just talked to my companion.
The first one, Borcha, had the same dialogue as in the originally M&B if you bumped into him in a tavern after losing a fight, so I was able to recruit him EXCEPT I had a full party, so I left the dialogue, dismissed some soldiers, and talked to him again. However, now Borcha threatens me, saying I should surrender or die. I'm assuming there's a bug in the companion-in-jail dialogue system.
I then talked to my other companions and was able to re-recruit them fine (without need of jail break, despite the fact that the jailer clearly said he's keeping the keys to the chains with him when I bribed him). Interestingly enough, I left the jail and bribed the guard again to try and re-recruit Borcha, but he's still threatening me. What's more, all my companions were still inside, despite the fact that it lists them in my party list. Talking to them yields the same threat dialogue that Borcha has. I left town to double check the lists: my companions have cloned themselves apparently. They appear in both the prisoners list AND in my party list.