The one thing that EVs require is an EV charger network to exist in the foreign countries that Toyota sells the cars to. Without an existing EV charger network, it becomes a chicken and the egg problem for Toyota since, as a Japanese company, it would likely face a difficult time getting financing to build EV charger networks in foreign countries.
Hydrogen fuel theoretically would just be an adaption of the existing petrol gas station infrastructure so the existing players/gas station networks would just need to switch over.
Now that ElectrifyAmerica is more "a thing", Toyota can start shifting strategies.
VW and Tesla/US car brands could move faster since they were required (VW) or had home court advantage and government support (Tesla/US car brands) to finance the US EV networks. The Korean autos switched earlier as they were probably more hungry and had less to lose on ICE than the Japanese incumbents.
There's also the game theoretical play that being the only major petrol based auto producer could lead to pricing power if the transition takes longer than expected.