BERLIN — Angela Merkel won a fourth term as chancellor in elections on Sunday, placing her in the front ranks of Germany’s postwar leaders, even as her victory was dimmed by the entry of a far-right party into parliament for the first time in more than 60 years, according to preliminary results.