Riding Hogwart's Express at park close

We are planning on transferring from USF to IOA on a day when USF closes at 5 p.m. for HHN. When do we need to be in the queue for HE? Do we have all the way until 5, or do we need to line up before that or risk being directed out of the park on foot? I imagine there’s a bit of a bottleneck at the train station as the park close approaches, and I have read that they are more aggressive at Universal about clearing folks out at closing time.

If I recall correctly, you can get into the line for HE up until 5. Maybe sneak in about five minutes beforehand, just in case. But beware, the wait can get LONG as everyone without an HHN ticket will be trying to get out and many will use HE as their way out.