There are a pair of books by Paul Smith and Sally Salmon - British Railway Stations Since 1901: An Essential Gazetteer and BRITISH RAILWAY STATIONS 1825-1900: An Essential Gazetteer - which list the stations with their National Grid References. Whether, if you contact the authors, they have and would be willing to make available the underlying data in digital format I've no idea.
Otherwise there is Quick’s Railway Passenger Station in Great Britain: A Chronology available on the RCTS website.
'Quick' is actually an RCHS (
Railway and Canal Historical Society) publication (not RCTS - credit where it is due), downloadable from them as a (large) PDF
The other 'standard' reference work is 'Clinker's register of Closed Passenger Stations' 1830-c1980'. But neither of these has grid references/precise locations.
I have come across reference to a 'Railway Record of the British Isles' database project, run by a group 'Industrialogical Associates', most of whom have now passed on - I don't know its current status, or whence or if a copy might be obtained, or to what extent it included what you're after.
Unless you can obtain a copy, (or even if you can?) I fear you're going to have to do a lot of data entry (and research)