Though not a rail line, the Dellwood Country Club in New City, New York, has an active city street that cuts through the middle of both the 1st & 17th holes. The course was built by Tilly as a private course for Hollywood mogul Adolf Zukor and after he died the city cited emminent domain and put this now very active connecting street through the property (early 60's?).
On the first hole the street is in play on the second shot to an uphill green. On the 17th, there is now a club rule preventing anyone from hitting a wood off the tee as the street down below is in play. In fact, if your drive manages to carry the road you are issued an actual fine by the club.