City to compensate more than 15,000 people who advocates say were locked up because they were too poor to pay legal fees.