For 80 years they roamed on the west side of Manhattan's Hell's Kitchen (Now Chelsea). By law, the New York Central Railroad had to have horsemen ride ahead of the electric engines to wave off pedestrians...

The story of these riders goes back to December 4, 1850 when the City Council passed a law compelling trains on the streets of New York to be preceded by a rider on horseback, on block ahead of the locomotive, waving a red flag by day and a red light by night to warn pedestrians and prevent runaways of horse-drawn vehicles. This quaint law is still in force, and the New York Central must, until it rises above the street, provide its riders or suffer revocation of its franchise.

The Tenth Avenue freight route extends from 30th Street south to St. John's yards below Canal Street, a distance of about two miles. To cover the operation of the various trains, a staff of twelve riders is maintained. These boys, who must all be over eighteen years old, are almost wholly recruited from Tenth Avenue and West Street, and strange as it may appear, riders are difficult to find, and only those who have, by strange fortune, learned to ride in the county are used, because a country boy knows and understands horses, and is thus prepared for any unexpected excitement that might affect his steed.

The "Ranch Boss" of these cowboys is the Superintendent of the New York Central Freight Yards, and since the law has been in effect two of the riders have risen from the range to the important position of Yard Masters.
This was replaced by the High Line which has now been converted into a park.

The Cowboys of New York