According to News18, the incident took place in the Aligarh district as the family was travelling in a van to attend an engagement.
They were accompanied by 24-year-old Puja Chauhan who is a close family friend, police said.
One of the travellers, Shafi Mohammad Abbasi, said the goons on motorcycles attacked the vehicle with iron rods.
"They would have killed us had not Puja Chauhan, who is like my daughter, stepped out of the van and came between us and the attackers," a visibly-shocked Abbasi told the media.
The mob identified the travellers since some of the women were wearing veils, according to a complaint filed at the Civil Lines police station.
"She boldly confronted the attackers who were all wearing saffron scarfs," Abbasi said.
"Why are you venting your anger on innocent persons?" Abbasi quoted Chouhan as saying. "She said that we are all equally shocked by the killing of the two-year-old girl."
Indian town on edge after murder of two-year-old
On hearing Chouhan's plea, Abbasi said, a member of the mob appeared to have softened his stand. "He quietly handed us our van keys and whispered: 'run off immediately'."
The family managed to reach Aligarh, although the driver's hands got severely injured.
Congress party leader and former Aligarh legislator Haji Zamirullah Khan, who accompanied the family to the police station, said: "I think Puja is a role model as a citizen of our country. At a time when humane behaviour is getting rare, she stood out courageously for humanity."
COMMENTS
Comments are moderated and generally will be posted if they are on-topic and not abusive.
For more information, please see our Comments FAQ