I'll say something else. The pirates have loads of RPGs. Hitting a 14 foot dingy will take a lot of training (and I don't think they have the time to do that). Hitting a 300 foot cargo ship with an RPG is comparatively easy at similar ranges.
While this is completely true, pirates?terrorists. Just being able to hit a ship with an RPG doesn't help them. Pirates don't gain anything by just causing damage to a ship, they either have to take the ship or the crew to get money for ransom.
If you make boarding a ship an incredible dangerous endeavour, by mounting guns on deck or hireing mercs to guard the ship, chances are that pirates back off or at least leave guarded ships alone.