Assuming the attack is a devastating one, with multiple strikes I think this problem divides into two parts:
In the immediate aftermath anything electronic will be fried, but old simple stuff may survive in a state that it can be reused, but in terms of any meaningfull rail service I dont think there would be enough organisation left to run it. The major cities would quickly degenerate into lawless wastelands. Those who could leave would do so, moving into remote rural areas where survival would be more likely. National grid, gone, refinaries, chemical works etc, destroyed, and who is going to man them even if they do survive. Food will run out, no clean water, disease will follow. Because of changes even since the cold war there would be no way of supporting large urban populations, even if law and order could be restored
Going forwards any use of railways would probably be on a local ad hoc basis to move stuff around the immediate area. Fuel beyond wood and possibly coal or bio diesel will be a finite resource, and most peoples major concern will be to grow enough food to survive. So if any use was made of the railways it would probably use stuff from the preserved networks. I assume a steam engine could be run on wood as long as you didnt mind having limited power. Bio-diesel is fairly easy to make, but you wouldn't be spending precious time and effort unless there was a compelling reason to do it. Crops are going to be grown for food. I suspect making effective weapons for protection would be a much higher priority for those who have the skills that might apply to building railway locos.
Longer term I would imagine once surviving stuff is no longer adequate some construction will begin, but its going to be very much "the dawn of railways" level, simple, slow, with the sort of fabrication that could be accomplished by a small group of people with simple tools, no welding, back to rivets, and will probably be steam driven because you can raise steam with a wide range of fuels. The other thing is you need a critical mass of population to be able support technology, you need specialists, and you can only support these if you have enough food and other resources.
So my view, you could probably get back to a mid Victorian level with maybe some additional enhancements, but to reach the current level of tech would require a lot of things to be in place first.
Food for thought: You could make a simple triode valve with equipment which could be cobbled together from salvage, one person with the knowledge and resources could do it, to make microchips and associated stuff that we take for granted requires a scale of production which would not be possible.
For anyone who wants to see one possible vision of a post nuclear future, read Lucifers Hammer by Niven and Pournelle, it refers to an asteroid stike, but I reckon it could apply to a devastating nuclear stike as well.
So modern steam in this context, well one hopes the knowledge wouldn't be lost, but you would probably end up with something closer to Rocket than Red Devil.