Rail–truck intermodal terminals are an important type of dry port and play a vital role in inland freight transport. This paper addresses the container loading problem in rail–truck intermodal terminals considering energy consumption under the sustainability concept. We analyze the effect factors of energy efficiency for container loading operations and develop an optimization model to minimize the total handling time and container reshuffling. A genetic algorithm is designed to obtain the optimal container loading sequence. Computational experiments on a specific Chinese rail–truck intermodal terminal were conducted to evaluate the performance of our approach. Results show our approach has a good performance for different sizes, and the total handing time, reshuffling times and energy consumption of the handling task are prominently decreased.