I attended the funeral of a young boy and a woman. The boy was placed at the front, closest to the people, and the woman was placed behind him. He prayed over them both. Among the people were Abu Saeed Khudri, Ibn Abbas, Abu Qatada, and Abu Hurairah. I asked them about this, and they replied, "This is the Sunnah."
أخبرنا محمد بن عبد الله بن يزيد قال حدثنا أبي قال حدثنا سعيد قال حدثني يزيد بن أبي حبيب عن عطاء بن أبي رباح
حضرت جنازة صبي وامرأة فقدم الصبي مما يلي القوم ووضعت المرأة وراءه فصلى عليهما وفي القوم أبو سعيد الخدري وابن عباس وأبو قتادة وأبو هريرة فسألتهم عن ذلك فقالوا السنة
[Its isnad is hasan]. Ahmad bin Abu Dawud narrated it, in the Book of Funerals, chapter on when funerals of men and women are present, who should be brought forward, no. 3193, from the hadith of Ammar bin Abu Ammar, the freedman of Harith bin Nawfal, through the same route. It is also found in Al-Kubra, no. 2104. Saeed here is Ibn Abu Ayub.