From Wikipedia:The Bay Ridge Branch is a rail line owned by the Long Island Rail Road and operated by the New York and Atlantic Railway in the U.S. State of New York. It is the longest freight-only line of the LIRR, connecting the Montauk Branch and CSX Transportation's Fremont Secondary (to the Hell Gate Bridge) at Glendale with the Upper New York Bay at Bay Ridge.Car float service provided by New York New Jersey Rail (formerly the New York Cross Harbor Railroad) is proposed to operate between Greenville Yard at Greenville, New Jersey and the LIRR / NY&A Bay Ridge 65th Street Yard. Currently the only car float service route is provided by New York New Jersey Rail between Greenville, NJ and Bush Terminal, Brooklyn.A proposed Cross-Harbor Rail Tunnel from New Jersey to Brooklyn would use the Bay Ridge Branch to reach the rest of Long Island, with the line upgraded to double-stack clearances.

The first part of the line was opened by the New York, Bay Ridge and Jamaica Railroad in 1876, from Bay Ridge to the crossing of the Brooklyn, Bath and Coney Island Railroad near New Utrecht. An extension from New Utrecht east and northeast to New Lots opened in 1877, and at the same time the New York and Manhattan Beach Railway opened the line from New Lots north to East New York. An extension north from East New York to Cooper Avenue (and then northwest to Greenpoint, later the Evergreen Branch) opened in 1878, and the Long Island City and Manhattan Beach Railroad (incorporated February 24, 1883, merged with the New York and Manhattan Beach and New York, Bay Ridge and Jamaica into the New York, Brooklyn and Manhattan Beach Railway August 27, 1885) built from Cooper Avenue north to the Montauk Branch at Glendale in 1883.

The entire line was electrified, starting on July 8, 1927, for New York, New Haven and Hartford Railroad freight trains coming off the New York Connecting Railroad (Hell Gate Bridge). Electric operation ended on December 31, 1968.