The train wreck is part of Hugo's dream. He has recently shown the drawing the automaton created to Méliès, who, in a state of sudden emotion, ejected Hugo from his home.
Hugo has felt that there is a part of his father's life which he can only access through repairing and understanding the origin of the automaton, and this rejection has left him reeling. This hurts all the more because even though Méliès is gruff with him, he has accepted Hugo as an apprentice, and is the closest thing Hugo has to a father figure.
He dreams of a train wreck, happening as he's attempting to retrieve the key from the track - the key that might give him a connection with his father, or perhaps more importantly access to a new father. The train wreck symbolizes that everything he's worked to resolve the mystery is crashing down, and in fact it is the key that makes him human. Without it he feels he has no place in society, and no right to happiness, as he's seen so many other orphans suffer at the hands of the stationmaster.
The reason it is that specific crash is that it originally occurred at that station, and so Hugo would have been familiar with the story, and probably have seen pictures of it. There doesn't seem to be anything particularly relevant about that accident and the film or Hugo, just that it occurred at the station the film is set in.