ouch!
It sounds like you were having a really good race. So sorry you hurt yourself. Railroad ties are lethal. I wiped out just stepping on one in my back yard and there is a railroad crossing on one of our road routes that regularly takes down cyclists.
You should feel good about how you raced before you went down and it sounds like there wasn't anything you could do to keep going after the crash.
Take it easy and let those bruises heal. I empathize as a technicolor hematoma 'crosser!