Not summary judgment. It was a preliminary (temporary) injunction. The standard for that is different than for summary judgment, though a win for a plaintiff on preliminary injunction doesn't usually bode well for the defendant when the case moves to determine if a permanent injunction should be issued. The speed of the ruling doesn't necessarily tell you the strength of the parties positions, though in this case the position of the government is quite weak and I agree the odds of the government winning are quite low. It is my understanding that this was not the legal position of IRS or its counsel, but rather that Treasury got upset that prisoners were getting checks, which it thought had a bad look. (And in an election year, I imagine Trump was not pleased.) It is not IRS counsel representing the government in this action, but DOJ tax division.