Also, doing that would be expensive; they’d have to be convinced that the costs of arming all of their ships (and hiring mercenaries to use the guns) is smaller than paying the occasional ransom for one ship. And again; there’s the danger that a ship full of armed mercenaries will simply decide to indulge in piracy itself. Or that the mercenaries will simply pirate the ship you put them on.