Uber Technologies Inc has agreed to pay $20 million to settle a lawsuit brought by drivers nearly six years ago, according to court filings, resolving one of its many legal battles with drivers ahead of a hotly anticipated initial public offering this year.