You have to remember WHY these railroads chose to electrify some of there lines.
New York Central electrified its lines into Grand Central Terminal because smoke pollution in the Park Avenue tunnel caused a terrible wreck, which lead to New York City banning steam operation in Manhattan. As a result New Haven had to start running electrics as well. But New Haven chose to go with A/C for their long distance trains to the city of New Haven in order to increase operational capacity (electric locomotives, especially at that time, could accelerate their trains much faster than steam power could).
Pennsy had to electrify into Manhattan because of the Hudson and East River tubes (as well as the NYC law). Initially they went with third rail D/C, but again to increase capacity they went to A/C to Washington DC.
Great Northern, Boston & Maine, and Norfolk & Western had tunnel restrictions which limited the number of trains which could pass because of ventilation problems with steam locomotives. Electrics could run through faster, and with no smoke to clear could run through more frequently.
Virginian and Milwaukee had heavy mountain grades which electrics could run faster than steam could at the time.
What happened was this:
The New York City electrifications still exist because of the tunnels and commuter service.
The Great Northern and Boston & Maine dieselized, and were able to provide adequate ventilation for the diesels.
Norfolk & Western relocated their line and built a new, larger tunnel with better ventilation, and faster steam locomotives which could pass through the tunnel in less time.
Milwaukee's electrification was obsolete by the early 1970's, and so was ended.
Virginian's system ended because of the merger in 1959 with the N&W. because of the difference in grades the ex-Virginian tracks became a one-way line, with trains going the other way on the N&W tracks. Since the electric locomotives couldn't return on the N&W tracks the electrification was ended.
While it is true that electrification was more expensive to set up, the actual maintenance on the locomotives was much lower than steam or diesels. The reason for the higher purchase price was the lack of standard designs.