It depends on how you are making hydrogen. If you’re doing electrolysis (splitting water with electricity), then it will be quite expensive, as you’re burning fossil fuels and needs loads of energy to drive the reaction.
However, if you’re using sunlight, then nope! It’s actually loads cheaper, especially the way that I’m doing it, by splitting water with sunlight, and a really cheap material called titanium dioxide that never gets used up.
To make any petrol, you need a lot of energy to distill the different oils off from the raw, mixed up crude oil at different temperatures, so that drives the cost and the pollution factor right up.