It is narrated from Sayyiduna Mughirah bin Shu'bah (may Allah be pleased with him) that the Prophet (peace and blessings be upon him) said: "The rider should walk behind the funeral, the one on foot may walk wherever he wishes, and the funeral prayer is offered over a child."
Hadith Referenceالمعجم الكبير للطبراني / باب الميم / 18170