Michigan will spend $87 million to replace thousands of aging water pipes in Flint to settle a federal lawsuit over lead-contaminated drinking water, promising to bring an end to a water crisis that made the city a national symbol of crumbling infrastructure.