Definitely take the LIRR+AirTrain on the way to JFK .. at that time of night traffic can be really bad ( it's not just getting out of Manhattan .. the traffic on the highways to JFK after the tunnel can easily take over an hour .. there's been construction on the highway between Jamaica and JFK for what seems like forever ) ... LIRR is dead easy if you're staying near the UN (i.e. within easy walk of Grand Central ) .. and the AirTrain at Jamaica used to be a pain with ticketing, but you can use Google Pay now ... Takes 35-40 minutes from the train leaving Grand Central ( they're very frequent ) .. it really is the only way to go
Taxi/Uber from Newark on the way in makes more sense though late at night .. trains less frequent then and they'll only drop you at Penn Station anyway which is not that close to where you'll be staying.