As usual, RR is right
I dug out the ole LSAT notes, and it varies by state. In some, you may be entitled to file exparte without notification and/or the right to appear at it. In some states it is different. However, as you point out, it is generally reserved for spouse or legal guardians of record.
I will say that in the limited research I have had time to do, I could NOT find a single other case where grandparents in a state that does not represent their rights to visitation or custody of a child with a living parent, were granted an ex parte order AND allowed to leave the US.
I get the whole
parens patriae and best interest of child and am thrilled to see it, I would LOVE to get a copy of the transcript of the actual hearing