You linked to Elon’s alt account, not exactly an unbiased source. Fact of the matter remains that operating in places with less free speech means that you have to submit to their less free speech. Old Twitter knew this, and so do other social media companies. Running a successful business means you can’t be an ideologue all the time.
This is not Elon’s “alt account” but rather X’s official account. It isn’t even a secret, since it is literally marked as an official account of X (see the golden checkmark). So I am not sure what you’re alleging. Even if it was an alt account, why would it matter - there is no bias in sharing the literal secret orders given or sharing excerpts from Brazilian law.
A lot of people are so ready to hate on Musk, that they associate anything that X does as Musk’s decision, even though the company has its own CEO. This account is an official account of X, and is marked as such explicitly (see golden checkmark). It’s not some subversive alt account like the GP claimed.
My understanding is X followed Brazilian law by deleting the 7 offending posts, but the judge is now acting outside of the law and is demanding things of which there is no legal basis. And apparently this judge has a history of doing things like this in unrelated cases.
If you do business in a country without a strong tradition of the rule of law, you have to accept that the law is not the supreme authority. Sometimes the authorities do what they want, and you have to deal with it if you want to continue doing business.
As long as the order is upheld on appeal, you have to obey it. That's how courts work in the US too. It's the judge who decides. Judicial appointments matter.