DETROIT — Investors are punishing automakers’ stocks this week after second-quarter earnings reports exposed industrywide issues of slowing sales and high prices, just as the companies are having to spend huge sums to make new electric and gas vehicles.