Batteries aren't as dense in terms of power storage as petroleum fuels, but hydrogen can be, so there's more focus on it in areas where you still need a lot of engine power - industrial vehicles, shipping, aviation, etc.
It has a lot of downsides though, not least that it's so explosive, and right now we don't have a way of producing it at scale without using fossil fuels so it's only potentially green. But a lot of people like the idea of it because it means you don't have to actually adapt too much infrastructure versus batteries. Eg there's a government study underway atm to see if we might be able to use the existing gas grid to pump hydrogen to homes for heating instead, whereas the alternative, a mass switch to electric heat pumps, would bring with it a huge extra demand on the electrical grid, and require a huge investment in upgrading capacity there.
For a lot of applications it's going to be a race between what comes first - higher-density batteries that can match fossil fuels per cubic metre, or clean hydrogen production.