The troops of Ottoman Empire had a way better army and technology than Faisal’s forces led by Lawrence and many other, but it was hard for Ottomans to take offensive action as the movement of the supplies was very difficult. After an unsuccessful attempt to capture Medina from Ottoman forces in October 1916, Lawrence convinced the Arabs to leave it alone and cut off the supply line instead. In March 1917, Lawrence led the first successful attack on Hejaz railroad which connected Medina to Damascus and the Dead Sea.
This was succeeded by many other such attacks by Arabs and other British and French officers. Later on, in 1918 October 1st, he successfully led Arab armies to Damascus where he found the Arab Revolt Flag already risen by the Arab Nationalists as the Ottoman Empire was in full retreat. Finally, On January 9th, 1919, cut off from the rest of the Ottoman Empire, Medina surrendered under the order from Turkish Government.