Police in the northern town of Bareilly say they used the instant messaging service to send out the boy’s photo to several mobile phones in the area.
A man travelling on a train, who had received the alert, recognised the boy sitting near him and called the police.
India has more than 900 million mobile users and WhatsApp is hugely popular.
The app, used by more than 400 million people globally every month, was bought by social networking site Facebook recently for $19bn (£12bn).
“We used various ways to publicise the boy’s story. We printed pamphlets and pasted them around Bareilly. We uploaded a digital copy of the poster on WhatsApp and sent it out as a chain message,” senior police officer SP Singh told BBC Hindi’s Tushar Banerjee.
“By chance, the message reached the right person,” he said.
“The message reached Daanish who had boarded the Doon Express train from Moradabad town [90km or 56 miles from Bareilly]. He recognised the boy from his photo,” Mr Singh added.
The boy’s father Paramjit Singh said his son had left home at around 0700 local time (0130 GMT) on Sunday for a ride on his bicycle, but did not return for many hours.
“We called all our relatives and friends, but couldn’t trace him. So we went to the police for help,” he added.
It is not clear how the child ended up on the train and police say they are investigating what happened during the hours that he left home and was finally traced, our correspondent says.
There have been instances of families using social networking tools to trace missing people in other Indian cities too.
Last month, another missing 11-year-old boy in Uttar Pradesh was traced to the Delhi railway station after his family publicised his case on Facebook and WhatsApp.