Essentially, the question of electrification is a trade-off: electrified railways are more energy efficient, the engines often supply more power and they are quieter and without local emissions while at the same time requiring a large up-front cost and additional maintenance. The benefits of electric railways are best played out when running many trains on the same line, especially if they have many stops and accelerate often.
On the other hand, while diesel is less energy efficient, has slightly higher running costs and a different complexity of moving parts, there is no additional up-front cost other than laying the rails, acquiring and distributing the fuel is easy and there are no problems with different standards if the network has multiple owners.
Electrification of (sub)urban and underground railways as well as electric tramways date back to the 19th century. At the time, the principal technology was steam; the main reasons for experimenting with electric systems was probably noise complaints and air quality (the latter is of particular concern in tunnels such as the London Underground). The advantages of electric traction over coal-powered steam engines were, however, quickly noticed and attempts to extend the technology of urban railways to main lines were made early. The first electrified full railway in Germany (and possibly the world) was opened in 1905 (it had run on steam for the previous five years due to lack of operating permission and the initially developed system being insufficient) between Murnau and Oberammergau. This line did not touch any major population centres but the landscape is rather hilly so the power advantages of electric traction could be exploited.
By the way, this is a pattern in Europe: most early electrifications were in hilly or mountainous areas, where large amounts of power were needed to climb, a situation that steam engines struggled with. On the other hand, these areas often provide ample opportunites for hydroelectricity which became the primary power source of many railways – especially in Switzerland which wanted to be more independent of coal (and later: oil) imports. In areas where electrification provided less of a benefit because less power was needed, it often progressed far slower or stalled altogether as coal was cheap overall.
After the Second World War, diesel traction started becoming a thing that would eventually displace steam traction on all non-electrified lines typically by the 1970’s. Diesel provided immense benefits over steam (no reliance on water, greater power output, only one person required in the cab all the while at a similarly cheap price as coal) while being able to use the same infrastructure – most notably, it also does not require any power lines to be built or catenary to supply the power to the engine. Now, the trade-off outlined above began to really matter: while coal was more obviously inferior in everything except price of the raw material and ease of construction, diesel could actually challenge electric traction on equal grounds, each having a use case where they are superior.
After all this backdrop, the actual answer follows here.
The mostly freight-only railways in the United States use most of the advantages diesel provides to the fullest. They typically run very long trains with lots of cargo (maximising profit per train while minimising driver cost). They tend to use more of the airspace above (e.g. double-stacking of containers, larger cars) as they have essentially unlimited clearance in most places. They tend to run fewer trains per line and the trains tend to run very long distances. There are many different lines that criss-cross the US (more than one might expect when looking at the Midwest’s population density), typically each belonging to a different company that will run trains along its own line. As the lines are mostly freight-only, the frequency of service doesn’t matter as long as there is sufficient capacity.
If these were electrified, that would mean they could either not use as much vertical space (or would need far taller pantographs). Each company would have to electrify its own lines at a high cost but the return in fuel savings would be far lower as there are not as many trains that can benefit. The power needs to be generated somewhere and distributed to the line; this is a significant problem in the sparsely populated Midwest. Finally, they would likely have to agree on some kind of standard as interoperability across companies exists in the current diesel-based system.
Contrast this with Europe: Most railways are or were nationalised allowing for a single national standard. A nationalised company has an easier time investing large sums for a slow return as electrification would provide. Most lines are primary passenger-oriented; the benefits of electrification for passengers are much higher than for freight (acceleration, noise and pollution are all more important). Thus, freight tends to be handled a little bit as an afterthought and has to follow passenger rail requirements rather than vice-versa. In addition, most freight runs along a smaller number of key trunk routes that are used by all freight companies; meaning that the single investment generates a return at a much faster rate. Finally, due to the more densely populated nature of most of Europe (Germany has almost 20 times the average population density Kansas has; even Lower Saxony still has 10 times the density of Kansas) pollution is more of a concern and electric infrastructure is more widespread.
A similar line of reasoning applies to Russia: the Transsiberian is the one single trunk railway that connects European Russia to Siberia and the Far East. The electrification of this one single line benefits so many trains including probably 50 % of long-distance and freight trains. The benefits are enormous and train density is large. Furthermore, the Transsiberian not only connects the major cities of Asian Russia but also actively developed the areas it was built through, leading to a string of higher population density all through the country which not only means more accessible infrastructure but also a greater ease of electrification.