I understand that outboard HP is measured at the prop and an inboard engine is measured before the gearbox. So at the prop shaft, an OB has the advantage.
Energy per gallon doesn't matter if it's burned in an inefficient engine and you get less HP-hours per gallon.