In a dramatic reversal, one of the world’s biggest makers of coal-fired power plants is to exit the market and focus on greener alternatives.