Social media giant X said on Thursday it expects Brazil's top court to order it to shut down, as a pitched legal battle plays out over compliance with local laws and owner Elon Musk's insistence the platform is being punished for resisting censorship.