The bridge carrying the canal over the Suburban Line at Craiglockhart Junction is a nice place to capture trains traversing the junction - you can get right down to the fence if you don't mind wading through a bit of vegetation. The view is towards Gorgie, and you can see the bridge where the mainline from Carstairs crosses the Sub in the distance. I'd be very impressed if you were lucky (and fast) enough to get a picture of a train on the mainline and on the Sub at the same time. Another okay location on the sub is the Braid Avenue bridge - best for trains coming from Millerhill towards Haymarket.
Finally, and again if you don't mind negotiating the odd bush, there's one or two good locations to take photos of trains going between Kingsknowe and Slateford where the Water of Leith walkway meets the Union Canal. If you're walking along the canal from the city centre, go up the path towards the bridge to get to the water of leith but don't turn back to cross the bridge, keep going towards the railway line and have a little explore in the trees. The views are at bottom-of-ballast fence level, so maybe a bit low (although I quite like them.) The track bends towards Slateford so there's not that much visibility in that direction (though there's certainly enough to get a decent photo, and you can hear trains in plenty of time to get ready) although in the other direction the track is perfectly straight all the way towards and past Kingsknowe so you can see trains approach from miles away.
Hope this helps.