When WordPress puts itself into maintenance mode, it does so by creating a file named “.maintenance” in the root folder of your WordPress site. To fix the WordPress stuck in maintenance mode problem, you’ll need to connect to your server via FTP (or cPanel in case of shared hosting) and delete that file.
Once you delete that file, your site should function as normal. It is also recommended that you clear the cache on your WordPress site.