To me, there are two factors that seem to be a part of this, looking historically (at least how I see it with little research into the subject!) at our railways.
Firstly, when the railways were built, any lineside foliage would have been removed for the building and unreplaced (likewise, a new road built now has little growth except new plants for 'carbon-offset' reasons).
The second part of my argument involves the fact that our railways are 'cleaner' than they once were, electric - and to a lesser extent, but relevant in this situation, diesel - traction has less emissions than steam locomotives, where there would also have been a risk of lineside fires (wasn't there a temporary halt on steam excursions on Network Rail because of this a few years back along?) meaning that any greenery would have been kept back naturally by the passing of fireboxes-on-wheels, and (relating to the first part) as time has progressed, the plants that couldn't grow are now able to flourish.
The only flaw in this - particularly the second part - is that heritage lines seem to also have a fair bit of lineside foliage...