Had you arrived a little sooner, you'd have seen the train. It stops outside the factory for a bit, then disappears, leaving its guns behind. You dive in and there isnt anything to shoot at, the shots appear to be coming out of the ground.
I'm not sure how long that continues, but I think the guns leave when the train respawns and starts it's journey towards town. Annoying isn't it? You have to either time your strikes so that you arrive while the train is at the other end of its track, or kill its guns before it gets to the factory.