In the early days of the railroad, steam trains made quick stops in small towns for water or to pick up passengers and cargo.
The crew would use this time to dash to the saloon or to make a quick visit to the local brothel.
While doing their business, the trainmen would hang their lit red kerosene lanterns outside so that the train wouldn’t leave without them.
And this is how areas practicing prostitution became known as red-light districts.
The phrase “red-light district” is also slang for the sleazy area of town.