The Chancellor’s Social Democrats defeated the far-right AfD in a closely-watched election in the state of Brandenburg.