A data-driven approach for quantifying the resilience of railway networks