The big difference here is the judge was restricting Trump as a government actor from doing something while the Twitter side of things is Twitter doing something on their own platform. Trump very much was using Twitter as the official place for announcements for a while and if it's the official place to learn government policy you can't block people from seeing it.