The settlement ends a dispute that dogged Trump throughout his presidential election campaign and led to one of the more controversial moments of his run when he claimed the judge overseeing two of the cases was biased because he was of Mexican ancestry.