In 2012, Donald J. Trump, the businessman, played a different tune on energy-efficiency subsidies. NYT reports.