Japan has no significant lithium deposits, and little oil. They rely on imports for both oil and lithium, creating a national security issue. Like China, they are at latitudes with high climate change impact, so they take that problem seriously, and fossil fuel is out, eventually.
They're between a rock and a hard place. If they build their transport system on lithium batteries, they can be cut off from lithium supply by adversaries.
They have a fantastic public transport system and do not rely on the car, even their kei cars are a luxury. Most Japanese can get where they want without a car, and those who insist on a car are often well-off enough that it's Ferrari or nothing with them.
Japanese car ownership is a big fat hairy deal, again, even a little kei car is like buying an American house, a huge investment in more than just the car. License tests are strict. You often must prove to the government that you have a place to park the car, in Tokyo, before they issue a plate, with all the real estate investment that implies. All Japanese cars are luxury cars. What's a few more yen in fuel costs? If it's too much, take the train, which is world-class.
The best future option for Japan is local hydrogen generation for non-train vehicles. Toyota, the "eldest son" of Japanese carmaking, has been tasked with putting together respectable hydrogen cars.
Toyota knows that the cars will not make much sense outside Japan, but hope to sell them as luxury vehicles to those, especially Americans, who do seem to love Toyota cars and ICE engines, offering them the vroom they like with carbon friendly fuels. Hopefully it keeps the fuel infrastructure alive in the West, and thus the market for future cars. The Americans will reliably buy much larger engines than the ones they normally sell in Japan. Large engines are the point.
The luxury cars, just the Murai, really, are a proving ground for technology that will ultimately power Japanese heavy trucks that currently rely on diesel. Honestly, if you've ever spent time around LNG forklifts, Japan is going for that, but carbon-neutral, because hydrogen. They already have enough technology to make cars go, it's just a matter of changing the fuel.
The trains can also be hydrogen fueled, with the expense spread across many passengers, though Japan has just enough oil for the trains, if needed. They'd rather that all their native diesel production go to trains. All the flagship trains are electric, anyway, but much of the Japanese train fleet is just plain old diesel, and perhaps that can be upgraded to hydrogen if necessary, or not, if that's the only diesel they need. Outside Japan this hydrogen doesn't make much sense. Inside Japan, it does.
Japan is a ship forever at sea, and it values fuel that can be produced on board than it does any fuel, oil or lithium, that must be dragged across the waves. Of course it is Toyota who has been called before the government and voluntold to sort something out for passenger cars, and trucks. Especially trucks.
Other nations are in similar positions to Japan, lacking lithium and oil, and worse, wealth to buy their way out. They, too, can build out train networks for efficient public transport and minimal use of oil, while the remaining luxury of personal cars and the necessity of heavy trucks can be met with locally made hydrogen fuels. The high fuel cost of hydrogen powered trucking can be split across many customers, making it make sense. Toyota has its eyes on these nations as customers in the future.
Of course, to us in the wealthy West, it all seems a bit silly, as though Toyota has gone mad. They have not. Somehow, the Americans have massive lithium deposits in the desert just when they need them. Just like they magically had oil, too. But Japan is not so fortunate, nor are many others. Toyota knows what they are doing.