Agencies ordered to pay more than $700,000 in legal costs in