Yo ho matey I be breaking the rules by announcing in a pirate accent that samurai be the most badass. But between them sea doggies and throat slitters I be going with the boys in black because stealth be badass!.
Seriously though, from a logical perspective, there's not a hole lot pirates can do that ninjas can't
Sword fighting: well pirates may be good sword fighters but ninjas got professional training
Fame, wealth, women: well, pirates got a hole lot more of the fame and women, but ninjas are hired assassins. Plus ninjas are trained to be deceptive, so they could just flirt their way into getting ass. Pirates paid for most of their wenches (or raped them)
On top of all this ninjas were trained assassins so while a pirate would raid a place to steal the treasure, a ninja would go in, kill the guy, steal his shit and they would never know he was there
Ninjas were trained professionals, but pirates were just crazy, greedy, drunk dudes with numbers some field experience and a lot of guns. Plus a ninja could learn some sea fairing and be a decent pirate in a couple years, but pirates would have to go through years and years of vigorous training (and learn some discipline) to do what ninjas do