Ayden was safely pulled out from the gap in time.
Watch the heart-stopping moment here
The incident took place at Sydney's Cronulla Station last year but the footage was released by Sydney Trains today as a warning to parents to be more vigilant with children hand while boarding trains.
Speaking to 9news.com, grandfather John Brewster said, "It took years off my life. I'll never forget it."
"It happened that bloody quick. We were running because it was raining, we'd had an ice-cream then we were taking the train because Ayden loves trains.
The video was released as a holiday warning ahead of Easter Sunday.
According to Daily Mirror, over 220 children found themselves in the same situation as Ayden on the Sydney trains network in 2016.
Click for more trending stories