A judge has chosen a winner in a battle of law firms vying to run a massive shareholder class action against BHP over the fatal collapse of a dam at its Brazilian mine, saying the funding arrangement behind the successful case would best serve class members.