They weren't in jail,none of the beast pirates were arrested by the alliance, also they had alcohol, and Aramaki said they "tested him", implying that King and Queen were the ones who attacked him.
The alliance had been partying for a week and were basically recovered