The federal Minister for the Environment has lost a bid to declass a class action brought over climate change risks from an expansion of the Whitehaven coal mine, with a judge making a declaration that the government owes a duty to all Australian children to protect them from global warming.