Since this was off the coast of Somalia it can be safely assumed that the pirates were Somali, and thus they were probably as high as kites of 'miraa' (I believe it is also called Khat). Miraa is a mild stimulant, but it does cause some euphoric effects. Effects that may make someone feel like they can take on an destroyer with an RPG. The pirates were probably stoked like hot coals when they 'attacked' the navy ship.
Back when Bubba had us in Somalia it was pointed out that Khat doesn't grow in the country, but rather was flown in daily, mainly from Kenya. It is only good a few days after being harvested. I've often wondered that if we wanted tackle Somalia we shouldn't start by a surprise interdiction of the Khat supplies. Declare the whole country a no fly zone, loiter some A10s over the main overland routes and blockade the coast. Their borders are long so we'd never get all the stuff, but we should be able to engineer a significant short term shortage. The sheer volume of the stuff consumed daily ensures that an improvised under fire replacement supply system will be less effective. The price would skyrocket and a lot of low level AK47 toting flunkies aren't going to be able to afford or even find their daily fix. Attacking gunmen undergoing acute drug withdrawal symptoms should be easier than those that are high on the stuff.