The companies that make train cars have a way to do this, so you probably just pay them to do it as part of the price you pay them to make you train car.