Not exactly a "mainline", but Portland's MAX line between Beaverton and Hillsboro is built on the old Oregon Electric Railway, which was an electric interurban from the 1910s until the mid-1930s; then continued as a steam and later diesel freight line (the Oregon Electric was a subsidiary of the Spokane, Portland & Seattle Railway, itself owned by Great Northern and Northern Pacific) until the early 1990s (under Burlington Northern ownership). In fact from Hillsboro west to Forest Grove, the old OE is still used as a freight branch, now operated by Portland & Western.
A small portion of the eastside MAX line in Gresham was also part of the Portland Traction Company and after termination of the interurban services in the 1950s because a freight line (jointly owned by Union Pacific and Southern Pacific) until the 1980s.
And currently is a proposal to re-use the route from Portland to Lake Oswego as a Streetcar (light rail) line - this was one of the first railroads built out of Portland, originally as a narrow-gauge steam line in the 1870s, converted to standard gauge in the early 1900s by Southern Pacific, electrified between 1914-1929 as part of the Red Electric service, and continued as a freight line until the early 1980s. Today the route is used for a tourist trolley (powered by a towed diesel generator) but there are plans to electrify it and restore it as an extension of the Portland Streetcar route.
I believe several of Los Angeles' light rail lines are built on old Pacific Electric right-of-ways, many of which were used for dieselized freight services for decades after the wires were pulled down.
--------------------------------------------------
Erik Halstead - Portland, Oregon