Recent advances in wireless communication, sensing and processing technologies are fostering novel research and innovation opportunities in areas such as Industry 4.0, Smart Cities and Intelligent Transportation Systems. In particular, the railway domain is envisioned to have important breakthroughs in terms of cost-efficiency, self-management, and reliability in the operation of the rolling stocks and infrastructures. Some of these key objectives are been addressed by the concept of Railway Virtual Coupling, which is a promising solution where the capacity of the tracks is highly improved by means of reducing the distance between adjacent trains, and the physical connection between train's compositions, through accurate Vehicle-to-Vehicle communication systems. In this work a new approach towards supporting the information dynamically exchanged by the trains is proposed, with the design and implementation of a Solid-State LIDAR based sensing system to provide an accurate, robust and low-latency on-board distance detection system between trains. The combination of a long-range distance sensor, an Internet of Things (IoT) edge hardware platform and a fuzzy clustering approach for distance detection of the object of interest allows obtaining very accurate results to support the virtual coupling maneuvers. The system implementation has been tested in a real railway scenario, where several coupling and distance detection maneuvers have been performed to verify the operation of the proposed system in an actual application context. This represents one of the first dedicated distance detection tests of this kind under real dynamic conditions documented in the literature towards railway virtual coupling.INDEX TERMS Edge nodes, Internet of Things, LIDAR sensing, railway application, wireless sensor networks.