As a former Army Ordnance officer I was involved in shipping a lot of military vehicles by rail.
Machine guns and other separate weapons, whether on external mounts or hull mounts, were never shipped with the vehicles, but were provided at the final destination.
All hatches and doors were closed and secured.
All glass, like windshields, was covered with banded plywood and where possible folded down flat.
Spare parts and any necessary equipment was crated and banded, shipped on the same train car, but never attached to the vehicle.
Main guns were placed in travel locks wherever provided, or otherwise turned to where they made the lowest and shortest overall length profile, with the muzzles capped and secured.
Tools, cables, chain, fuel cans, radios, etc were all shipped separately and / or provided at final receiving site.
A lot of canvas tarps were used to cover and protect anything we shipped, as well as rope, chain, and banding of many kinds.
And it wasn't uncommon to see a boxcar train of brand new tires headed for the west coast... or batteries, or bare wheels, or window glass, or new seats for M-151 jeeps, etc.
I never got to deal with providing munitions of any size but it must have been awesome to see.