Railroad can be repaired fast (already Germans during WW2 were able to repair a direct hit within 5 hours and less). Bridges would be a better target but are guarded by armed sentries.
Russia was dependent on western companies when we speak about refinery technology and major ones pulled out after invasion. Attacking distillation columns seems to create a bottleneck. I think Ukrainians know why they chose to hit them.