A federal judge in Brazil has ordered mining giants BHP, Vale and their Samarco iron ore joint venture to pay 47.6bn reais ($9.67bn) in damages over a deadly dam burst in 2015.