The carmaker was hurt by aggressive competition in electric vehicles in China and weak demand at home in Japan.