Cities demand vast amounts of energy for their everyday operation, resulting in significant degradation of energy in the form of heat in the urban environment. This leads to high cooling requirements in cities, while also presenting the opportunity to reuse such waste heat in order to provide low-carbon heating for buildings and processes. Among the many potential energy sources that could be exploited in urban areas, underground railway tunnels are particularly attractive, as the operation of the trains produce considerable amounts of heat throughout the year. This paper reviews how secondary energy sources in urban areas can be integrated into heating and cooling networks, with emphasis on underground rail tunnels. This involves investigating potential urban waste heat sources and the existing state-of-the-art technologies that could be applied to efficiently recover this secondary energy, as well as analyzing how district heating and cooling networks have been a key mechanism to allow for a smooth transition from current fossil fuel based to future low-carbon energy sources.