ninja I have to say Ninjas. Not to say pirates aren't cool, but the truth of the matter is, Pirates are criminals and murderers. While the lore behind them is fascinating, in the end, what they did was strike terror into the hearts of sailors and trade ships.
Don't get me wrong, Ninjas aren't the greatest either. In ancient Japan, the ninja was everything but an honorable profession. Samurai considered them to be nothing but swine and were constantly fighting "Unfair". Their practical use of instruments and surroundings in order to gain advantage over the samurai was considered dishonorable.
They were spies, hired to gather information and assassinate high ranking officials and military officers. As I said before, I say Ninjas only as a personal opinion, but if the two were to clash I just don't see how a Pirate would win.
Let the debate begin with this: Ninja were proficient at avoiding battle altogether and even blended into an enemies ranks in order to gain their trust before a kill. If a battle WERE to ensue and they were forced to defend themselves, more often then not the Ninja would disable, disarm, or use the opponents weapon against them.