Pirates, definitely. Ninjas only seemed badass because they went against Samurai by mastering the one thing a Samurai was never supposed to do. Namely, cheating.
But a Pirate can also cheat very well, so you have a one trick pony against someone much more versatile. The ninja's showing would be respectable, but I gotta give this to the pirate.
Lets look at the roster here:
Black eggs (powdered glass filled eggs)
Ninjuto (Short sword)
Shuriken (no matter how they're thrown they hit with the blade)
blow gun with puffer fish poison
Kama and chain
Blunderbuss (Shotgun of the time)
clay pot grenades
All of witch are muzzle-loaded one shots. Most of a pirates power was in his ship. Heck they might not even be able to swim. :)
The pirates have the range, but the ninja has the close in.
Ninja were not a one-trick pony, samurai could blur lines when they wanted to. Personally I think a Spartan warrior would kick both of them up and down the street.