Ninja. Every time. I don't even understand how anyone could think a pirate would win. Even with their guns, and on a boat, a ninja would win. The guns that the pirates (not those Somalian bastards with boats that pretend to be pirates) had only fired like 1 round a minute and had to have each round hand loaded. A ninja's hand-to-hand combat skills are superior, their swordsmanship is likely superior, they're better at drawing opponents into one-on-one battles through stealth, and the list just keeps going. Everything about a ninja is superior to a pirate in every way, except maybe alcohol tolerance.