In the late 1880s the mansion house of Drydenbank, near Bilston Glen Viaduct, collapsed, having been undermined by coal working. Investigation disclosed that coal workings were moving towards the railway viaduct, and would certainly disrupt it. Negotiation with the colliery owner resulted in a demand for £152,500. The NBR sought powers to replace the viaduct with an embankment, but this was objected to by landowner, and after arbitration by the Board of Trade found that coal reservation of £25,000 would suffice to protect the viaduct, and the NBR was obliged to accept that. Eventually the NBR replaced the viaduct in 1892. The first bus service from Roslin to Edinburgh started in 1914, immediately affecting passenger carryings on the line. During World War I Gilmerton station was closed from 1 January 1917, being reopened on 2 June 1919. The railways of Great Britain were "grouped" in 1923 following the Railways Act 1921, and the North British Railway was a constituent of the new London and North Eastern Railway (LNER). In the 1930s competition from local bus services intensified considerably and the railway passenger traffic declined steeply, resulting in the passenger service on the line closing on 1 May 1933. The railways were again reorganised by government on nationalisation in 1948; the area was now part of the Scottish Region of British Railways. A new pit at Bilston Glen opened in 1952 as an extension of the Burghlee Colliery (and of the branch to it), and mineral traffic flows on the branch increased considerably. However Penicuik gasworks closed in 1956, removing the last regular traffic from the extension. At that time, the line was cut back to a point immediately south of Glencorse station, to continue to serve the Barracks, but the line was again shortened to Roslin from 31 August 1959, and only mineral traffic continued on the branch, the ordinary goods facilities at Gilmerton, Roslin and Glencorse being withdrawn. However, as late as the summer of 1960, passenger excursion trains used the line. Bilston Glen Colliery opened in April 1961; at the time this was a modern show-piece for the National Coal Board, and further mineral traffic was brought to the line. Roslin colliery closed in January 1969 and the line was abandoned from the north end of Bilston viaduct southwards. The line closed completely in 1989, except for a headshunt at Millerhill Junction.