In the Impel Down Arc, it was said that Shiryu (also known as Shiryu of the Rain) is on par with Magellan in terms of strength. How did they put Shiryu in his cage if he is on equal strength with the Chief Warden Magellan?
From One Piece Wikia:
His strength is also said to be equal to the Chief Warden Magellan. However, since Magellan's work hours are limited by his diarrhea, Shiliew was considered more dangerous. Despite this, Magellan was still able to suppress Shiliew and place him in a cell in Level 6.
So you are right about their strength. But I could imagine that they trapped him, or Magellan asked an Admiral for support.
About their strength: I believe Shiryu has no chance against Magellan, because of his Venom-Venom Fruit. He just has to hit him a few times, or maybe just once to poison him and that would be Shiryu's end.