The Japanese automaker announced on Wednesday that it would build a new EV and battery factory in Shanghai, after Tesla did the same in 2019.