Turrets that can be installed in trains are bought in markets. They can be hard to notice on a list because you usually find one unit located in the top left corner of a station platform. A basic riffle on a stand (Williams) differs from Gatling gun - it has shorter reach, its fire rate and damage are lower but it costs less than a half of Gatling gun's price. You can place it in any of the carriages (the best way to place them is to install those weapons in the first carriage, if you buy two) - those weapons can only be deployed in the back of crew carriage which provides defense during escapes. Their ammunition is limited - they are reloaded automatically when you stop in one if the cities. Everyone can use those turrets - if you want to increase their usability you should place someone with Cannoneer ability near them.