The electric-vehicle maker benefited from price cuts and discounts amid tougher competition in the EV market.