The railway running past here, which was opened in 1884, was the Edinburgh Suburban Line, which closed to passenger services in 1962, but is still in use for freight traffic and sometimes diverted traffic. This was the site of Blackford Hill Station and the gate here would have been an entrance to the platform on the south side of the rail tracks. I have attached a print from the 1896 Ordnance Survey map taken from the National Library of Scotland’s website and the first noticeable feature is the lack of housing here at that time. There was a waiting room on the south platform, as well as on the north platform and it looks like the ticket office was located next to the waiting room on the north platform. You can still see on Blackford Avenue the place where steps went down to the north platform. You will also see on the map that there was a footbridge between the north and south platforms.
Congratulations to the Wee-Zs on a very quick FTF.