The Indian man lay between the rails at Wuppertal train station in western Germany clutching the child as the train rolled over them.
The man arrived in the country in March 2010 and was due to be deported to his homeland next month.
Local media speculated he may have been trying to injure himself to prevent deportation, but there was no explanation for taking the child with him.
The boy was slightly hurt, but his would-be killer was unharmed as the train rolled harmlessly above them.
His mother, who was on the platform with her other children aged one and three, was comforted by fellow travellers as medics pulled her son to safety.
Police say the attacker is ‘known’ to them and had attempted suicide before.
‘The family were complete strangers to him. He simply walked up to them, grabbed the little boy without a word,’ police said.
‘Then he jumped from the platform to track number five and ran towards the incoming train on track nine.
‘The driver made an emergency stop. But the first wagon rolled over them both.
‘The boy only has abrasions. The man remained unharmed. He is now being investigated for attempted murder in a psychiatric facility.’
Stay updated with the latest Nigerian news from Information Nigeria