Several films depict ice being present in desert locations and without electricity. Basically...how?
It wasn't, it melted. Just slower in rail cars designed to keep cold. Like you putting ice in a cooler. It melts but slower than in other containers.
Basically - insulation. Depending on what time period we're talking about, either the ice was carved from somewhere where it was cold enough to be frozen (Thoreau writes about workers cutting ice off of Walden pond) and then shipped in insulated ships to where it needed to be. Later, ice factories would make ice for home use in iceboxes, and you'd have to buy it every once in a while. Basically all these relies on the fact that if properly insulated, and in large amounts, things can stay frozen for very long times without refrigeration.