Trade ships are well aware that they can risk problems in these waters, and sure they would be able to have light weapons in self-defense, and the pirates know that the ships have some form of defense, so perhaps they are reluctant to attack
There are a verity of countermeasures short of small arms or heavy weapons available to merchant vessels today...