Germany’s main political parties worked out a compromise plan to cut power-industry pollution by handing a six-year lifeline to some of the dirtiest coal-fired plants.