1938 Railway gun TM-3-12

Humongous Railway Gun (used during the siege of Leningrad). This railway gun of the TM-3-12 model (below) can be seen at the St. Petersburg Outdoor Train Museum. This was not part of an armoured train, but was actually built with others in the late 1930s using guns taken from a battleship and placed on a rail chassis. It was used in World War II, but captured by the Finns and used during the siege of Leningrad. When Finland ended their war with the USSR in 1944, the gun was handed over as part of the peace agreement:

https://www.darkroastedblend.com/2013/05/awesome-armoured-trains-and-rail.html

A railway gun, also called a railroad gun, is a large artillery piece, often surplus naval artillery, mounted on, transported by, and fired from a specially designed railway wagon. Many countries have built railway guns, but the best-known are the large Krupp-built pieces used by Germany in World War I and World War II. Smaller guns were often part of an armoured train. Only able to be moved where there were good tracks, which could be destroyed by artillery bombardment or airstrike, railway guns were phased out after World War II.

https://en.wikipedia.org/wiki/Railway_gun