Thick fabric is a good sound absorber, but the sound will get in even through walls if you're close enough to the tracks. If your concern is for sleeping, look for sound dampening curtains that will fit well past the window woodwork. A sound machine or fan can help muffle the sound, as well, so it's not as sudden and disruptive.
My insulated curtains do a lot to keep sound out. I found information that said...
To keep noise from entering your space, look for sound blockers. These products can be applied over doors, windows, and walls or in between cracks where these items meet. Soundproofing materials are measured by how much noise they block (you can read more about the rating system here at Soundproof Cow).
We live about two miles from a train track that the trains mainly are used at night and we hear the whistles at night like they are just down the block. I haven't found a way to dampen that sound yet, it just carries so far at night when it is quiet.
Layer your window treatments. Pull down shades, drapes, and sheers. Also the pliable removable putty for the cracks. If you can replace the windows with the best you can afford - at least a double pane window.