The heavy and empty wagon flow assignment with work division among multi-marshalling stations in railway terminal is presented. The problem is formulated as a nonlinear mathematical programming model which considers some constraints indicating train arrival and departure, train breakup and makeup, wagons accumulation and wagons transshipping between different marshalling stations. The objective function makes minimization of the total cost of heavy and empty wagons entering, leaving, transshipping and accumulation. As an NP problem, using traditional method for solving the model is difficult and inefficient. A novel two-stage comprehensive optimization procedure is given and is abbreviated as TSCOP. We propose a solving procedure to match train and marshalling station. The matching scheme is given by the capacity constraints group denoting train arrival and departure, and then the matching scheme is firstly updated by the capacity constraints group denoting train breakup, accumulation and makeup. And then the matching scheme is secondly updated by the capacity constraint denoting wagons transshipping. So the initial matching scheme set can be obtained. Moreover the matching scheme is coded as natural number sequence. The selection ratio is given and is adopted to choose a certain number of schemes to set up the filtered scheme set. An asynchronous iteration heuristic with replacing, variation and exchange operation is provided to find the optimal matching scheme from the filtered scheme set. The experimental scenarios are given to test the proposed heuristic. And the proposed heuristic is compared with some other approaches and the performance of the proposed heuristic is evaluated by some different sized cases.