Well. Assuming pirates had guns and the samurai used bows (most samurai believed swords to be ineffective in combat compared to a bow and arrow)...
The guns are faster on the draw compared to bow and arrow, and if the samurai had no armor the samurai would be as good as dead. However if the pirate missed it would take longer for them longer to reload giving the samurai a chance to get some arrows in (assuming the samurai didn't miss). However a pirate would opt for a blade faster than a samurai, making a close up kill possible.
It could go either way with the edge towards the pirate.
Waffles or french toast?