Optimal trip planning in transport systems with random delays