The efficiencies being offered for IC engines is the maximum, however it varies enormously with different speed and load. At idle (doing no useful work) the efficiency is by definition zero. The real downside of an ICE is that it typically spends a lot of time running at very low efficiency. Engineering of an ICE system can make it work at more efficient regions for more of the time (downsizing, high gear ratios, different operating cycles to reduce pumping losses for example). A best BSFC of 250g/kWhr equates to around 34% thermal efficiency for a petrol engine, but off the optimum speed/load point a BSFC of 350g/kWhr is only 24%. In the attached image, running at 1500rpm and 1.5Bar BMEP (around 20Nm in that engine) it's more like 450g/kWhr and 18%.
A fuel cell or battery motor system doesn't suffer this very poor efficiency at light load/low speed which is typical of a ICE.
Storing energy in any form takes more input than you get back out again (entropy increases - law of thermodynamics - can't be avoided), think of it as thermodynamic friction. Doing it in some forms means a much bigger entropy increase (lower efficiency) than for other forms. Charging a battery produces heat and thus losses, you don't get out as many kWhrs as you put in. Producing free hydrogen from a compound takes energy. The trick is to use a storage and recovery system which is reasonably efficient and practically executable in the real world. Stored energy density, kWhr/kg and kWhr/litre volume, are both significant for any mobile (vehicle) system, but might not be as important for a static system (generating mains electricity etc). $/kWhr is the final deciding factor.