At least 21 people died Tuesday in an attempted breakout from a prison in northern Brazil aided by an armed group on the outside trying to blow up a wall, officials said.