Hydrogen-oxygen fuel cells, such as SOFC, have maximum specific energy density of ~ 17.9 MJ/kg (using 142 MJ/kg for compressed hydrogen and including oxygen at 1:7.93 2H-O mass fraction yielding water at a stoichiometrically perfect air to fuel ratio). Other chemical components yield lower specific energy density since they're using higher molar mass fuels. Incidentally, this is also the reason why LOX/LH2 achieve highest specific impulse among chemical rockets. Now, theoretically highest fuel cell efficiency, assuming heat recapture, is at 85–90%. So we're down to maximum theoretical specific energy density of ~ 16 MJ/kg.
Conversely, plutonium (Pu-238) powered RTGs have specific energy density of 2,239,000 MJ/kg. If we assume they generate sufficient power for one quarter its half-life of 87.7 years, let's round it up to 20 years, we've made use of 14.6% of its total power density, and efficiency of 7% (pretty good for a RTG, most of its energy ends up as waste heat), we end up with our system power density of 22,916 MJ/kg. That's over 1,400 times more than our best chemical fuels when it comes to power density (which is what matters when it comes to moving mass around).
And it's not that RTGs are that much more efficient, they're not, it's just that chemical energy doesn't come in very mass efficient form. Fuel cells will have some advantages over RTGs, such as being able to dump no longer needed reaction products overboard or even find its use elsewhere (coolant, potable water, biological shielding,...), not having to shield against own fuel's radioactive decay, and so on, but it will also come with disadvantages, such as still requiring thick-walled or heavily heat shielded pressure vessels not to lose too much of it to space due to fuel boil-off, energy efficient fuel cells will still generate a lot of excess heat that needs to be efficiently radiated away, etc. Not that RTGs don't need that, but fuel cells won't have so many advantages over them to offset those 1,400 times the difference in power density.
And since we're already discussing nuclear, RTGs are completely overshadowed by nuclear fission reactors with specific energy density of 79,420,000 (thorium) to 80,620,000 (uranium). And there are compact, space application ready nuclear fission reactor designs, like SAFE, SP-100, SNAP-10A, HOMER-15 to name a few, mostly using Heatpipe Power Systems (HPS) design. We just have to overcome our aversion to anything nuclear and start regulating their development, testing and use so they're as much of an option as they're safe to use.