Being a martial artist myself, I'm definatly partial to the ninja for several reasons.
1: Ninjas were very knowledgeable in vital points to strike, making them vastly more effective in a fistfight.
2. Ninjas were skilled in the use of more weapons than I can count, including: Ninjato (short sword), spear, manrikigusari (Chain with weights), Kusarigama (chain scythe), Kama (hand scythe), tonfa, shuriken (traditionally used more for distraction than actual killing), Fukimi Bari (needles spit from the mouth), bagh naghs (claws), ashuko and Shuko (Hand and foot spikes for climbing), Kunai (throwing knives), Jo and Bo staves, Bows, Escrima sticks, nunchaku, san setsu kon Nunchaku (three sectioned, but smaller sections than a staff)... and a whole mess I'm sure I'm forgetting.
By contrast, pirates used flintlock pistols that were horribly inaccurate even at point blank range, and prone to backfires, misfires, and all sorts of mayhem. Pirates usually used a flintlock in conjunction with a saber or cutlass (though these were not strictly the only weapons they used). Their skill with a sword was limited to what they could learn from the best swordsman on deck, who essentially figured out how to use a sword himself, whereas Shinobi used techniques handed down for hundreds of years with rigourous accuracy.
3. Ninja were strictly sober when "working"... and pirates were definatly not. This hinders the pirates.
4. Shinobi used carefully laid out plans, and smart deployment of their numbers in large-scale attacks. Pirates used confusion and loud noises to startle their opponents, and shock them into defeat. As Shinobi usually attacked at the time where the least people were awake, they met with far more success on a "raid" than Pirates.
5. Shinobi were also masters of indirect fighting. A well-timed distraction with a swift followup attack works incredibly well. Pirates were far, far more direct, as one can see a boat comming from miles off, and it's hard to "sneak up" on someone at sea.
6. Use of poisons and disease puts Ninja ahead in the biological warfare game. Poisoning a ship's water supply will guarantee the death of the crew in just a few days, as Seawater is not very good for drinking, and ports were far away.
7. With proper training, a Ninja could win a straight fistfight without surprise in a few seconds, using simple techniques to break the knees, elbows, rupture internal organs, break the collarbone or sternum etc. Shinobi also trained in fighting several armed or unarmed opponents at once. Pirates rarely trained in such things. They just tried to overwhelm their opponents.
Overall, the question of who'd win in a fight is more than clear BUT that wasn't necessarily the question. The question was who is cooler, and pirates are still pretty damn cool. I impersonate them on a regular basis, usually while under the influence
I'm partial to feats of skill and training, so I cast my vote for the Ninja, while raising my mug to the Pirates as a worthy runner-up.