Japanese automakers have lagged behind big rivals in EVs and are now trying to cut costs and make up for lost time.