In reply to frenchyd :
A very difficult to answer question, dependent on a lot of factors.
Fairbanks-Morse, Baldwin, and Lima-Hamilton products were often done after less than two decades. A large part of that was that their oddball nature meant that railroads just didn't want to put up with them. Also, major manufacturer support went away after their manufacturers left the locomotive markets fairly early on (F-M stopped building locomotives for the US in 1958 and it's last locomotive was in '63, Baldwin was pulled out of the market by parent company Westinghouse in '56, and Lima-Hamilton was swallowed up by Baldwin in a merger in '51). But some of them were repowered with more common power plants or soldiered on on short lines or insular industrial lines for decades. The Tennessee Valley Authority was operating their Fairbanks-Morse H-16-66 until into the 1990s.
Alco/MLW products held on for a while in Class I service. Alco built locomotives until 1969, their Canadian subsidiary MLW built locomotives until 1985, and Fairbanks-Morse actually ended up with the rights to the Alco 251 engine and continues to supply some parts. There were quite a few RS-3s hanging around on Class Is until the 1970s, some 20-25 years after they rolled out of the factory, and the D&H had RS-36s, built in 1962, still in service after Canadian Pacific bought the D&H in '91 and CNW had 1965-built C628s running in heavy ore drag service until 1990. While there aren't any Alcos left on Class Is anymore, there are plenty of them still active elsewhere; Batten Kill Railroad still has a pair of RS-3s running, now 70+ years old, and will soon have an even-older RS-1 running, while Delaware-Lackawanna in Pennsylvania is an all-Alco show and has everything from 1950s RS-3s up to 1980s MLW M636s in regular service.
GEs historically tended to be rather short-lived. GE offered attractive 15 year financing, but their main engine was a little harder to work on, their products didn't hold up very well (as one engineer put it "What Alco made from steel and brass, GE made from aluminum and tin"), and GE refused to license service parts for aftermarket manufacturing, which made parts for them very expensive. GE also tends not to support models, as a way of forcing railroads to continue to buy the latest and greatest. Typically, when the 15 year financing ran out on GEs, they were sent back because they were absolutely worn out, and replaced with new GEs. The Universal-series locomotives that they got into the market with in the '50s are almost entirely extinct and there certainly are none active on Class Is (last I heard, Lake Superior & Ishpeming still had a few and Pickens Railroad has a bunch of the odd "Baby Boat" U18Bs running) and the later mid-'70s Dash-7s series are also borderline extinct and there are none on Class Is. The Dash-8s, introduced in the late-1980s are still holding on here and there, but even those are dwindling, or they are being heavily rebuilt. The Dash-9s, introduced in 1993 are still fairly common though, and those are headed for 30 years old. The big issue that the Dash-8s and Dash-9s face are the microprocessor controls are pretty complicated and now obsolete, making them harder to keep running and resulting in most shortlines not being too interested in them. The Genesis passenger units, the face of Amtrak since the 1990s, are also starting to be phased out, and a large part of it is that GE no longer supports them with parts.
EMD, as befitting what was once a division of General Motors, is the king of long lives. Amtrak still has a 1941-built SW1 switcher in regular service, EMD FL9s from 1958 were running into the mid-2000s on Long Island Rail Road and Metro North commuter trains, Canadian National up until recently still had some twenty-plus ex-Illinois Central GP9s (dating back to 1954-1963) in service, albeit heavily rebuilt, and BNSF had, again heavily rebuilt, 1950s and 1960s EMD GP30s and GP35s, running up until about ten or so years ago. The EMD -38/-39/-40 series locomotives, which were kind of the Tri-Five Chevy of locomotives, can still be found everywhere, Class Is, regionals, shortlines, leasing companies, you name it. EMD was the king of standardization and provided tons of support for older models. Their 567 engine (named because it was 567 cubic inches per cylinder) is more or less still in production, since the 645 series engine was an overbored 567, and the current 710 engine is a stroked 645. There's a lot of building block mentality there, with the ability to take a 567 block, install 645 liners and pistons and heads, and have a more modern and powerful engine. There are tons of old EMDs out there that are on their third or fourth major rebuild, with new cabs, engines rebuilt with turbos and 645 power packs, and upgraded to modern EMD Dash-2 electrical systems. Kind of a Ship of Theseus situation. EMD for a while was also the gold standard of passenger power, with their FP7s/FP9s and E7s/E8s/E9s running into the '70s, and Amtrak actually wanted them to build an "E10" but EMD had destroyed the E-series body tooling in the '60s due to the decline in passenger locomotive orders. They fumbled things with the SDP40F-2, but won it back with the F40PH in 1976, which while Amtrak has retired them all, they are still running elsewhere in North America, including on VIA Rail, although they are starting to be phased out.