Defects on the railway track occur due to the abrasive effects of time and usage. As the magnitude of the defects increases, uncomfortable travel appears. If the defects progress further they may cause derailment of the train. Detection of the defects are performed by manual inspection of the track, which cause ignorance of some of the defects. In this study a heuristic algorithm, which detects railway track from the images acquired by unmanned vehicle, is developed. Rails and sleepers of the railway track is detected with high accuracy from the images acquired in nadir direction. Images are de-noised by Gauss filter and edges are detected by Prewitt Edge Detection algorithm. By considering the geometric properties of the railway track and the brightness values of the edges, the Heuristic algorithm decides on which edges belong to railway track. In this study, inspection of railways is proposed by the images acquired by unmanned aerial vehicles and the automated detection of railway elements are realized as the first step of the railway inspection.