Toyota, Subaru, Mazda and Nissan are ramping up next-generation electric-vehicle programs with sweeping plans for new battery factories and government subsidies for new technology including solid-state battery production as Japan Inc. races to catch up with the global EV leaders.