The CV of hydrogen is about 137 MJ/kg, compared with 44 MJ/kg, about 35 MJ/litre, for petrol and diesel.Look at the energy density of liquid hydrogen, and compressed hydrogen, try 1000PSI and 1000Bar, and compare those three numbers to petrol or diesel.
Then factor in the next level of loss being the weight of the container for the hydrogen and look at the net energy density. I cannot see how it makes any economic sense to even try.
I don't think anybody's suggesting liquid hydrogen for road transport. Might be a case for trains or ships.
I believe compressed hydrogen for cars is at 700 bar, giving about 8 MJ/litre. A lot lower than petrol, but efficiency of a fuel cell is higher than an ICE, which helps.
But it isn't a case of comparing hydrogen with petrol and diesel, because if the government keeps to its threats, they will be banned. The comparison must be between hydrogen and other acceptable solutions, like battery electric.