Detecting VPN usage is really easy. Most VPN protocols and services are trivial to detect based on packet analysis. Banning VPNs is an extremely serious threat to a free society.
But Brazil didn’t ban VPNs. They banned using VPNs to access Twttier/X.
They just need to identify that you might have a Twitter account, and then show that you've been using a VPN. Which given their judicial standards, probably won't be hard... Also, good chance they move on to banning VPNs outright anyway.
On the first part: the goal is likely to scare big brazilian accounts of influencers, politicians, etc to stop using X. Bc their identitt is known and they could easily be fined. They then expect brazilian users to follow them to another platform. On the second part: he did ban VPNs briefly, ordering they be removed from the play store and the app store, but then went back on it, but maintained that if people use them to access X, then they could be fined. So it is indeed, very possible that VPNs will be banned at some point. We are at the mercy of this judge's whims...
Actually, the first court order demanded google and apple to remove vpn apps from their app stores, and the wording about fines is ambiguous about using vpns to access X or using them in general. The demand for vpn apps removal was rolled back, though.