The imbalance of global trade exacerbates the mismatch between supply and demand of empty containers, requiring rapid repositioning from import to export regions, so empty container repositioning has long been a focus of research. Compared to maritime repositioning, hinterland empty container repositioning is more complex because it occurs over a sophisticated multimodal transport network. Rail and inland waterways typically offer high capacity at lower cost, and hinterland container operators often consolidate containers and move them in batches to achieve economies of scale. In addition, demurrage and detention (D&D) charges, imposed on operators for delayed container returns, have remained high in recent years. Traditional hinterland empty container repositioning approaches that focus solely on transportation costs often overlook these time-related penalties, leading to higher total repositioning costs. To address this, we first develop a generic hinterland empty container repositioning optimization model that integrates both transportation costs and demurrage and detention charges while capturing batch-based dispatching characteristics observed in practice. Second, due to the model’s non-convex and combinatorial nature, traditional solvers struggle to provide efficient solutions. We further develop an improved genetic algorithm (GA) to solve this non-convex MINLP problem. The results of numerical experiments showcase the benign performance of our improved GA. Finally, we conduct a real-world case study based on a 2025 operation in China. The results demonstrate that minimizing transportation costs alone results in higher total repositioning expenses, while jointly optimizing transportation and D&D costs leads to more balanced and cost-effective repositioning strategies. This highlights the practical necessity of incorporating D&D considerations into HECR decision.