When this moving train suddenly collides against a stationary train, there is a large change in the momentum of the moving train. This large change in momentum of the train is brought about in a very short interval of time.
Thus, according to newton's second law of motion (Force=Change in momentum/Time taken), a large retarding force acts on the train. Due to this large force, huge damage to the train takes place.