A prison riot has left at least 56 dead, in the bloodiest violence in more than two decades in Brazil.