Germany's opposition Social Democrats and Greens narrowly defeated Angela Merkel's center-right coalition parties in a state election Sunday, in a tight race that showed the complications the popular chancellor may face in winning a third term in a general election later this year.