Derailments significantly harm railroads in terms of severity and fatality rates. Manually monitoring railway tracks is a tedious and often insufficient task to prevent derailment accidents. This necessitates the development of an automated monitoring system to oversee the condition of railway tracks. In the foreseeable future, Unmanned Aerial Vehicles (UAVs), artificial intelligence, and computer vision will play a crucial role in periodically assessing the railway environment to ensure passenger safety. This paper proposes a lightweight and efficient railroad semantic segmentation network (Lite-RSNet), which segments real-time aerial railroad images into rails, gauges, and backgrounds. The segmented regions then compute the distance between rails and obstacles, identifying potential derailment hazards in railroad applications. Lite-RSNet incorporates a multi-level feature fusion framework that includes a residual layer, a multi-head attention layer, a Concurrent Spatial and Channel Squeeze Excitation (CSSE) block, and a Convolutional Block Attention Module (CBAM). The designed approach enhances onboard processing efficiency by streamlining the model to use fewer parameters and reduce storage demands. Performance assessment of the model utilized the Rail Segmentation Dataset (RSD), which consists of high-resolution, low-altitude aerial photographs of Indian railroads. The Lite-RSNet model outperforms current leading methods, maintaining a lean structure with only 6 million parameters and achieving notable metrics of 0.971 for the Dice Coefficient (DC) and 0.947 for the Jaccard Index (JI) on the test dataset. Furthermore, distance estimation between an obstacle and rail has been implemented using image processing techniques as an additional work of this proposal to know about the caution of an obstacle.