An article in The Railway Magazine, August 1905 discussed the use of 'Railway' and 'Railroad' in different jurisdictions around the world at the turn of the 20th century. As the linked article suggests, there was considerable uncertainty over the use of the two terms. http://rogerfarnworth.com/2024/08/14/railway-or-railroad/
Here in the U.S., both were used, with "Railroad" the more common. When U.S. railroads emerged from bankruptcy, their names were sometimes changed only from Railroad to Railway. This preserved their identity, but under a different legal name.
"Ultimately the CBC says that usage often boils down to “convention and individual preference.”" This says it all quite nicely.There were even some here in the States, which underwent multiple changes. Railroad to Railway, then back to Railroad again.