The problem is that crippling the ship generally means the power plant, maneuver, and jump drives no longer work. That in turn makes it pretty hard to use them to accomplish a self-destruction.
True, and leaving it fuelless acomplishes all at once...
On the other hand, it won't take a lot of hydrogen on the whole to flood the ship sufficiently for a nice fuel-air mixture to detonate. Since the ship would have lots of separate tanks rather than one big one, it's going to be likely that one or more survived. You'd only need battery or emergency power to operate the valves and sensors. Adding extra oxygen only makes it even easier to do.
The mix doesn't even have to be that precise to get an explosion, and if you're off a bit you still get an nice fire that burns the compartment out.
Of course, in the OP scenario wouldn't it just be easier to set the ship on a "death spiral" into a gas giant or star and have some sort of control disable that means the boarders either get off or ride the ship down to its destruction than some sort of blow the ship up device?
Another thing to keep in mind is that a ship being boarded is likely to be in vacuum, be it due to battle damage or to standard practice to avoid explosive decompression (probably both). A hijack attempt, though, is another matter...