Just an FYI that Joomla 3.10-alpha has now been released so the upgrade process can now easily done.
Go to the Joomla Update Component Options and switch the Update Channel to Testing and the Minimum Stability option to Alpha.
Update to 3.10 alpha1 using the Joomla Update Component.
After you have updated to 3.10 alpha please switch the Update
You need to wait for 3.10.X to become available; as per the documentation, "This guide assumes you are starting on Joomla 3.10.x. If you are on a earlier version make sure you upgrade to Joomla 3.10 first before moving to Joomla 4."
Joomla 3.10 is currently in development, at 86% completion, most notably, with no completion date for release. V3.10-...
I had a similar 504 timeout issue when trying to run updates with one particular web host and their solution was to add the following to the start of the .htaccess file:
<Files ~ ".php">
SetEnvIf Request_URI "index.php" DynamicTimeout=600
SetEnvIf Request_URI "/administrator/index.php" ...
Gantry v4.1.32 was the last supported version for Joomla 2.5.
I suggest trying to install the latest version of Gantry for Joomla 3.x which is Gantry v4.1.43.
Ideally, you should also also be updating Joomla and PHP (and any other third party extensions) to the latest versions.