Immediately after a disaster, such as a flood, wildfire or earthquake, networks might be congested or disrupted and not suitable for supporting the traffic generated by rescuers. In these situations, the use of a traditional fixed-gateway approach would not be effective due to the mobility of the rescuers. In the present work, a double-layer network system named LoRaUAV has been designed and evaluated with the purpose of finding a solution to the aforementioned issues. LoRaUAV is based on a WiFi ad hoc network of Unmanned Aerial Vehicle (UAV) gateways acting as relays for the traffic generated between mobile LoRaWAN nodes and a remote Base Station (BS). The core of the system is a completely distributed mobility algorithm based on virtual spring forces that periodically updates the UAV topology to adapt to the movement of ground nodes. LoRaUAV has been successfully implemented in ns-3 and its performance has been comparatively evaluated in wild area firefighting scenarios, using Packet Reception Ratio (PRR) and end-to-end delay as the main performance metrics. It is observed that the Connection Recovery and Maintenance (CRM) and Movement Prediction (MP) mechanisms implemented in LoRaUAV effectively help improve the PRR, with the only disadvantage of a higher delay affecting a small percentage of packets caused by buffer delays and disconnections.