The girl was filmed by a journalist in Bulandshahr sitting on the floor of a tiny enclosure, reaching out at the mesh wire that kept her behind bars.
The woman officer heading the police station, a sub-inspector and two constables have been suspended.
The court wants the Uttar Pradesh government to report details of the incident on Monday.
The child was brought to the police station by her mother on Sunday night and was sent to a local hospital for medical tests. The next morning, when they returned to the police station, the mother was forced to leave and the young girl was put into what served as a holding bay for nearly the entire day, till senior police officers were shown the video footage and intervened.
Police say the preliminary medical report of the girl does not show any external injury. A final report is awaited.