A Cheaper solution for catching the train from Penn Station to JFK is the subway/JFK Airport Airtrain method.
From Penn Station in NYC, the E train will take you to the LIRR/JFK Airport Airtrain (Sutphin Blvd.) station in about 45 minutes.
Then it’s a 12-15 minute ride to the airline terminals.