Hydrogen generally does rely on the power grid, or often it can. You need electricity to generate hydrogen. I see a fuel cell as a "fancy battery", it stores energy, it does not generate energy.
While it has notable advantages over batteries, it has disadvantages as well. In 1905, there was competition between ICE cars, steam powered cars, and electric cars. I doubt anyone knew then which would dominate (and eliminate all others). Early engines were pretty bad, complicated, prone to failure, and we had little gasoline at the time.