The court was hearing petitions filed in 2014 that sought the historic mosque to be declared a protected monument and the removal of all encroachments in and around it