Brazil’s leftist presidential challenger had polling edge, but right-wing incumbent surged to force runoff