Unless you are able to shoot outside in the sunlight, you will need a camera capable of slow shutter speeds, including time exposures of several seconds. This also means you must be able to mount the camera on a tripod and use a remote shutter release. If your camera doesn't have remote release capability, you can usually use the self-timer to trip the shutter to avoid any camera shake during the exposure.
Large format, medium format, and 35mm cameras will make excellent pictures of model railroads with the right equipment and technique. For most of us, however, the 35mm camera will be the most economical alternative. Trying to use any 35mm camera other than a single lens reflex will be very frustrating as only the SLR lets you actually preview your scene through the lens. A note of caution though--only some pro SLR's show 100% of the actual image in the viewfinder. Most SLR's show only 94% or even 92%. This means you could have something in the edge of the final image you didn't see when you took the picture. This is less of a problem if you shoot slides, because the slide mount is very close to the viewfinder image of most SLR's. If you are shooting digital, you can crop the image in Photoshop to remove any unwanted elements that show up in the image. Of course, you can also check your images immediately after exposure and adjust the lens or camera position to fill the frame with the image you want, so it's really not a problem at all.
As long as your SLR or DSLR body accepts interchangeable lenses, a shutter release, has a tripod socket, and can make time exposures, the cost and brand are not important. Any good camera body will do, and used ones can be bought from reputable camera stores and mail order houses at reasonable prices.