As a track engineer, I can assist:
Normally, we try to provide 'full normal' clearances, where everything would be at least 1.625mm away from the nearest running edge.
This can be reduced to 1.624m (yep, 1mm different, great standards!) for things less than 2m long and signals, to 1.470m for OLE masts, and 1.364m for signals located between two tracks with insufficient space for normal clearances.
If clearances are reduced below those levels, we then go into calculations of each train vs each piece of infrastructure so we go into the lists of stock that are 'cleared' for a particular route.
We would try to provide a normal minimum clearance, from a train to a fixed anything, of 100mm.
This sounds low, but has some caveats:
1) This is from the kinematic envelope of the train, not from the static profile. In other words, we use software to determine the train's maximum ever size, taking into account all possibilities such as suspension failed, tilt (where fitted) failed, crush laden, empty, in high winds, full range of speeds etc etc - all things which will affect, ever so slightly, where the train will be in any particular passage. There are all added up and a shape produced for each train that is then used for clearance calculations on each pice of track. It's done for each structure, so takes into account the radius, cant and speed.
2) It's less than the normal clearances as given above, and thus requires specific approval at design stage before it's permitted. However, gaining approval is relatively easy and there are a huge number of instances of these clearances in existence all over the network.
3) The software has a lot of tolerances built in, and it's extremely unlikely that they will all ever happen together, so the actual clearance provided is often 30-50mm+ greater than the number that pops out of the software.
There is also a further requirement that, where trains with openable windows run, this be increased to at least 450mm at the height of the window to allow for persons leaning out. This is not mandated though, only a 'where possible'.
If we can't provide that, we can reduce this to a 'reduced clearance' of 50mm. This requires approval that is harder to get, and must be accompanied by a risk assessment and possibly mitigation measures, such as provision of enhanced track and structure monitoring to ensure movements over time do not compromise this further.
If we are still struggling, we can reduce this to 'special reduced clearance' of 25mm. This is hard to get approved and is nearly always only approved on a temporary basis with good risk mitigation measures in place, such as it being a concrete structure next to slab track.
How this relates to when window bars are provided I'm not sure, but I think it's up to each TOC. It's easy for the TOCs to see what clearances exist on any particular route they are planning to run trains along so I think it's up to them to do their own risk assessments of how many tight clearances they will pass, how fast they will be going, how visible they are etc. I'll leave someone from a rolling stock background to clarify that though - I may be wrong.