There's no indication they knew Gotham was under attack.
They were in the middle of huge party (to which Batman had NOT been invited)...
As TVTropes says...
The entire invasion of Gotham can't have lasted more than a few hours. The Justice League were probably still partying and didn't even know what was going in. Perhaps one of the crystals Batman smashed controlled a form of alert system to big crisis, meaning the Justice League were never made aware of the events in Gotham because of Batman smashing all those crystals.
Also, there is a second Trope
It's simply a fact that some characters are more powerful than others. This trope comes into play when two or more characters who are on the same team have blatantly different levels of power and live in the same universe, but the stronger of them always stays out of anything the weaker character(s) have trouble with. This is because their powers would instantly solve the problems of the weaker hero(es) and thus fail to preserve drama.