No ship and no ship’s crew should work in a known pirate zone without at the very least personal weapons on board. They might be locked in a magazine during most of the voyage, but the moment you move into pirate waters weapons should be distributed and kept close at hand.
Others have commented that, on a large automated ship, there is often no one on deck. Obviously, in pirate waters you have to have someone on pirate watch around the clock.
And the navy needs to have a rapid response team. If it takes 20 hours for a ship to get to you, that isn’t much help. They need to have assault teams ready to go as soon as the word comes that a ship is being approached. A fixed wing plane could be on the scene within short order to sink or drive off the attacker, and a chopper with the assault team could be there within an hour or so to secure the ship if necessary. We have to do more than we’re doing.
They would get in range of some cargo ship and then BAM, unload on it.
Sank a lot of ships...I think it was called the Atlantis.
We just need to park a carrier task force there. Complete contol of a 1,000 mi diameter battle space. A Mayaday ges out, sink the pirate ships and then the mother ship.
This is very doable.