If you are stuck in Maintenance Mode – please read following:
Maintenance Mode
When one Enables the Maintenance Mode, it creates a file called maintenance.htm in the site files' directory. (moodledata/1)
The site is still in Maintenance Mode if that file exists
When one Disables the maintenance mode, the system deleted the file and moodle comes out of Maintenance Mode.