Uber and Lyft have agreed to pay $175 million to Massachusetts to resolve a four-year-old lawsuit accusing the rideshare companies of misclassifying drivers as independent contractors.