Optimization for train schedules of freight trains is extremely complex. Having a tight schedule is very efficient, but the impact of delays and cancellation rises and puts an environmentally sustainable and accurately timed supply of goods at risk. In order to address these issues, the Rail Cargo Austria commissioned a proof of concept that incorporates the optimization of train schedules with an agent-based model that tests the robustness of the optimized schedule against delays. Thereby the delays do not have to be incorporated into the optimization directly which would make the optimization problem even more complex and impossible to solve with classic techniques. Additionally, the use of historical data of freight train runs is integrated into the proof of concept and certain parameters for the simulation are gathered by data analysis and machine learning techniques. In this paper the agent-based model and a scenario to show its capabilities are presented.