Australia’s biggest mining company has agreed to a massive settlement with the Brazilian government over an environmental catastrophe.