It basically comes down to cost. The electric infrastructure costs per mile to install, and per mile per year to maintain. The benefits come per train. If you don't have enough trains per day, it's not economical to electrify.
There are some places, like the Union Pacific around North Platte, where you'd think that electrification would be a natural. But the problem is that 90 miles east of North Platte, and 20 miles west of North Platte, the lines split, and the traffic density goes down. Switching between electric and diesel locomotives twice in 110 miles adds operating cost.
I wonder at which point diesel becomes the cleaner option here, if ever. One the one hand, you have to lug a lot of fuel around over longer distances (or you need refueling infrastructure). On the other hand, transmission losses can be significant.
If it's a somewhat loaded segment, someone would be there to consume the regenerated power. If it's not loaded then yes, no point in electrifying it to begin with.