TrainTimes already has a map (http://traintimes.org.uk/map/#bhm) although I'm not sure of their data source.
I've looked at this before and it's already doable through the network rail api (https://datafeeds.networkrail.co.uk/), which differs from the national rail enquiries api and as far as I can remember (and can see) is free.