First, you say AirTrain - - The AirTrain only runs from Jamaica Staion to the airport terminals, so first, you hafto get to Jamaica.
I've done the above a zillion times, via the E train. It can be anywhere from a breeze to a major pain.
If you're at Penn Station, you can also take the LIRR to Jamaica (which I have never done), but it's more expensive - $8.75/full fare - $6.25/off peak - $4.25/senior/disabled. The LIRR schedule shows 21 minutes on this route, which is faster than the E subway train. If you're flying BE, the LIRR option may be more relaxing than the rush hour, possibly jam packed E train.