Brazil’s federal government has reached a multibillion-dollar settlement with the mining companies responsible for a 2015 dam collapse that has been called the country’s worst environmental disaster.