Lawmakers spent two years negotiating a compromise that would protect sexual assault survivors’ path to justice without bankrupting cash-strapped school districts, cities and counties.