A six-month-old baby boy whose pram rolled onto railway tracks in front of an oncoming train in Melbourne has survived with only a bump to the head.

Watch the footage

The child, who was strapped into his stroller when the accident occurred, was dragged about 35 metres by the train as it pulled into Ashburton station in Melbourne's east yesterday afternoon.

'The pram rolled a very short distance straight over the edge of the platform and onto the tracks right as the train was coming in,' Connex trains spokesman John Rees told AFP.

'The baby has gotten away with just a cut on the forehead.'

Mr Rees said the driver slammed on the brakes as hard as possible as soon as he saw the pram tumble in front of him, and was aided by the fact that the train was slowing down as it entered the station.

Paramedics, who arrived to find the baby being comforted by his mother, confirmed the child received a bump on his head.

'Luckily he was strapped into his pram at the time, which probably saved his life,' paramedic Jon Wright said in a statement.

The accident occurred one day after Connex issued a child safety awareness campaign focusing on warning parents to keep infants strapped into their prams at all times while on train platforms.