A tree has blocked a major train line causing disruption in and out of York, which is expected to last all day, National Rail has said.