Several early "steam road" electrifications used third rail, as well as subways and elevateds, including NYC, LIRR, PRR to Manhattan Transfer, and B&O in the Baltimore tunnel. What they all had in common was that they didn't have long distance lines and had relatively few level crossings where safety would be a concern. When transmitting electricity long distances, high voltage lines lose less power than low voltage lines. However high voltage transmission lines require more expensive voltage changing equipment at both the power house and at the substations. (Railroads had to generate and transmit their own electricity in those days.) So for short electrified lines it was simpler to use lower voltages and simple substations. Low contact wire voltages in DC electric traction use would be around 600 volts, while high voltages would be 2,000 to 3,000. Transmission line voltages would be higher. (I've never heard of an AC system using low voltages.) Early traction motors were designed for 600 volts so if current was picked up at a higher voltage, transformers would be needed to reduce it. This was not a big concern for locomotives but would have been for early MU cars.
For streetcars with their light weights, short train lengths and modest speeds, sufficient current at 600 volts can be carried in an overhead trolley wire. For heavy mainline use, a trolley wire would not be large enough to carry sufficient current at 600 volts. The only alternatives were to use a thick third rail, or increase the voltage, which would reduce the amount of current to what a trolley wire could carry.
Another consideration was the cost of overhead wires and their supports. These can be quite light for streetcars and interurbans, which are themselves fairly light and generally not too fast. For heavy trains at high speed a more substantial catenary structure was necessary both to absorb the stresses from the pantographs, and to support more and larger wires needed to carry greater currents.
There was another reason why longer distance lines would not want to use third rail, apart fro the cost and complexity of machinery to reduce the necessary high transmission voltage to around 600 volts as mentioned above. The other would be the danger of people, animals and fallen trees contacting the third rail in uncontrolled rural areas, together with the cost of constantly patrolling and clearing away debris that could foul the third rail.
If a railroad was going to run a comparatively long distance it would pretty much have to choose catenary. Having done so, it could choose AC or DC. That’s why the NYC chose third rail and New Haven chose AC overhead wires.
This explanation may have missed or misinterpreted some of the physics and electrical engineering involved, but I think it explains the basics.