The right shutter speed- Always use the shutter speed in proportion to the focal length of your lens when the camera is hand held. And never at lower than 1/60th sec. There is always the camera shake and at speeds lower than this, it is long enough to get recorded on the film/sensor. With longer focal lnegths the camera shake is more and so is the magnification of the camera shake.Tripod- If you need to use slower shutter speeds always use a steady tripod. For very slow shutter speeds or criticl shots one may even use the mirror lock up option along with the self timer. Mirror lock up will raise the mirror before the actual exposure avoiding the vibrations caused by the mirror movement. self timer avoids any vibration which our finger may cause. remmember, tripod only takes care of the camera movement and not the subject movement. To freeze that, higher shutter speed is the only option. If using the tripod is too cumbersome one may even use a monopod for slow but relatively higher shutter speed. A monopod may work well for a shutter speed of 1/15th or 1/30th os sec but not for 5 secs. A monopod avoids the vertical downward movement but does not restrict the sideways movement.Image stabilization and Vibration reduction- These are the features in the new lenses and some cameras which reduce the effect of the camera shake to quite a large extent. One can shoot hand held at a relatively slower shutter speeds. This again cannot avoid or reduce the subject movement. A tripod avoids the camera shake where as IS or VR system avoids the efeect of the camera shake.
ISO- sometimes if you do not have any other means like a tripod or an IS lens increasing the ISO may be the only alternative. Higher ISOs are more sensitive towards the light enabling you to use a higher shutter speed. At times in low light situation if the subject is moving too fast you may incerase the ISO to freeze the action. Tripod as mentioned earlier cannot freeze the subject movement. remmember that an incerase in ISO incerases the noise as well. However the new generation digital cameras are much better in terms of noise at higher ISO.
FLASH- Flash can be added to freeze the subject movement even when a slower shutter speed is being used otherwise. Since the duration of the burst of flash is very brief and the manin source of exposing the subject it acts simmilar to using a high shutter speed. If the shutter speed is too low the ambient light may influence the photograph along with the frozen effect of the flash
Also very important is how you hold and grip the camera- you should be in the most stable position when taking a picture. hold your breath or wait for a while if you have just run accross to reach the spot.
Sometimes it is actually desirable to add blur to you pictures or to a aprt fo them for a more dramatic effect or to convey a feeling of movement to it. In panning shots, the background is actually blurred to show the speed.
It wont have been a good idea to blur the train movement