Carmakers are struggling to make electric vehicles affordable for pinched consumers—and rethinking their investments amid sagging demand