Transportation of hazardous materials (Hazmat) is one of the most important aspects of transportation planning, which poses several risks to the physical and social environment. These risks have become one of the most important concerns of planners, and as a result, any considerations that can reduce costs and environmental risks are important. Since establishing an intermodal transportation network by different modes of transportation have a key role in transportation planning of hazmat, and lack of proper decision-making may impose high costs and endanger society, in this research, for the first time, the problem of routing and intermodal terminal location is considered simultaneously. This problem is formulated as a mixed-integer nonlinear programming problem for load management of regular and hazmat freights by the railroad intermodal transportation that considers congestion in multiple states and determines the appropriate equipment capacity. In order to validate the proposed model with the objective functions of minimizing the total transportation risk and operating costs, different test problems are solved by the elastic method. Due to the computational complexity of the problem, a metaheuristic algorithm, namely sub-population genetic algorithm (SPGA), is also developed to obtain near-optimal Pareto solutions. In addition, several experiments are provided to compare the SPGA and multi-objective particle swarm optimization, which has recently been presented in the literature. Finally, the obtained results are analyzed, and the efficiency of the algorithm is examined using some performance metrics.