Reliable Obstacle Detection for Smart Automation of Rail Transport