Elon Musk mocked and attacked a Brazilian Supreme Court judge early on Thursday, hours after the billionaire’s social media platform X was given a 24-hour deadline to appoint a local legal representative for the company or face a ban in the country.