Residents gathered through the night at a historic mosque in Ujjain ahead of a planned demolition and a court hearing, The Indian Express reported.