It is well known that the shift of transporting bulk cargo from roads to railways is an important measure to reduce carbon emissions of the overall transportation systems. In order to increase the attractiveness of railway transport, companies usually provide some discounts to the customers with great transport demand so that entire trains can be operated. Since the operation of entire trains can reduce the reclassification times of shipments, the expenses of railway operations can be reduced. However, when the volume of shipment is not sufficient, the door-to-door direct transportation (in the railway industry specifically, “door-to-door” means running trains from supplier’s warehouse to customer’s warehouse) of the entire train often leads to a decrease in the frequency of delivery, which increases the average stock of users, thus increasing the inventory cost of users. Therefore, how to balance the pros and cons of the two is exactly the problem to be studied. In this paper, the optimal operation plan is obtained by minimizing the total cost of the stockholding of suppliers and customers, as well as the transportation costs of an entire train and non-direct train. Based on the classic economic order quantity (EOQ) model, a 0-1 integer programming model with the constraint of the maximum stock level is proposed to solve this problem. And an innovative approach is used to calculate the actual average stock of the customer. Finally, the model is validated and its effectiveness is confirmed using a real-world case, which is carried out using data from the China rail system.