We have to look at this scientifically, where is the battle taking place? Land or Water?

If on the pirates ship then the pirates have the upper hand. They used firearms and swords. And the Ninja who rely on hiding would find it hard, since the pirates are knowledgeable about the ship they live on.

If it takes place on land. If the pirates went ashore then the Ninja would almost certainly win. They would pick them off one by one via blowguns or shirken while concealing there positions.