It's because japan can't really compete with china in the EV battery space (nor can anyone else really).
By betting on hydrogen, it's possible to take the lead in a smaller pond as a bigger fish. Tho i'm not a believer in hydrogen - it's too difficult, and costs just as much to transition to that as it would electric. It'd be easier to synthesize carbon-based fuels, and that leverages the existing infrastructure for petrol in place for use.