Unfortunately, a lot of shipping companies are pacifists when it comes to pirate attacks. They refuse to arm and train their crews.
No, I am not talking about a traditional 18th Century 'Defense Against Pirate Attack' with the crew and pirates sword fighting on the deck of their ship with cutlasses.
While a merchant ship at sea, radar and infrared systems could detect the approach of any pirate vessels to the merchant ship. Then remotely operated Quad Fifty gun turrets could pop out of the deck and IF the pirates didn't leave the area after being warned-a short burst would take care of the problem.
I also like the idea of a few "Q Ships" based on the old World War I II models where war ships disguised as merchant ships swiftly blow away the pirates that approach the Q Ships.