Nicholas D'Agostino allegedly killed Yusef Staine at the Ronkonkoma station.
The suspect is being held overnight in Yonkers before being arraigned Friday in Riverhead.
News 12 is told the two men were traveling together.
Police will release more details on the arrest Friday afternoon.