Optimizing train stopping patterns for congestion management