Before Lawrence arrived the Arabs had already taken Jiddah, Ragbegh, Yendo, and Qufidia, while their only major setback had been at Medina. So I don't know what you're talking about when you say they were getting their arses handed to them, seems like they were doing quite well by all appearances.
Lawrences strategic contribution was to suggest that they attack the Hijaz railroad rather than take the cities, which was not a boon to the Arabs who wanted those cities but rather a boon to the British who wanted the Ottomans tied down defending the railroad.
Faisal and Sharif Husain had tens of thousands of men what they lacked was equipment, they had a small number of largely antiquated rifles, little artillery to speak of, and no airplanes or real motorized veichles. Lawrence wasn't what helped them win, it was the British providing them with rifles, artillery, and machine guns. And of course the Ottomans were heavily committed on other fronts.
You give credit to Lawrence where none is due. I've seen little to indicate that Lawrence played any major role in uniting the Arabs, and the movie as a whole was just awful.
Considering the fact that the power-base of the Arabs was in the Arabian Peninsular, where they ruled as vassals for the Turks, and all of those cities you mentioned were cities which they already ruled on behalf of the Turks, with only small Turkish garrisons, it would be somewhat surprising if they didn't capture those cities. The only city in the entire peninsular with a sizable Turkish garrison was Medina, and that's where the Arabs were defeated. Decisively so.
The Turks were also routinely launching raids from Medina, meaning that the Arabs hadn't actually consolidated the territory that they had taken. Put a few aircraft in Medina - which the Turks were planning on doing - and the Arab rebellion would be incapable of operating within a certain radius of the garrison. Say goodbye to any chance of winning.
The Turks had also been somewhat busy fighting on both the Russian and Dardanelles fronts, which limited the available troops to use in pacifying rebellions. And the Arab Revolt was nowhere near as potentially dangerous for the Turks, whose power-base was Anatolia, as the feared Armenian and Greek rebellions, which is why they expended so much effort ethnically cleansing Anatolia. Not to mention the Egyptian and Mesopotamian fronts, where the Turks successfully fought off the British.
Lawrence's suggestion to attack the Hijaz railroad rather than the cities was most definitely a boon to the Arabs. The Arabs were physically incapable of taking Medina. It was too well-defended and fortified. The weapons that could take it were needed far more urgently in France than they were in Arabia. Few of those cannons even reached Egypt and only then long after Lawrence's arrival. So the only way for the Arabs to take Medina - and other cities along the railroad - was by starving the Turks out.
By attacking the railroad the Arabs forced the Turks to do one of two things; they could withdraw from Medina and the Peninsular, leaving it to the Arabs, or; expend massive amounts of energy guarding the railroad and protecting supply convoys, weakening themselves on other fronts. The Turks, who feared the Arab Revolt might provide an example to other groups in the Empire if succesful, sought to keep face by retaining Medina. It was the incorrect strategic decision and if you read
Seven Pillars of Wisdom you'll note that it was actually not what Lawrence expected or aimed at. He thought the Turks would withdraw.
This is a classic strategy. If your enemy occupies an unassailable position, you do not waste your forces in attacking it. Instead, you cut the more lightly-defended areas surrounding the impregnable fortress, specifically the supply lines. Either the defender stays in their fortress until they eventually starve or they withdraw, saving their army but relinquishing the fortress to the enemy. Consider Stalingrad, which is a very similar case. The Germans could have withdrawn and saved their army, but instead they stayed until, starving and desperate, they were forced to surrender in order to avoid complete destruction. Lawrence expected the Turks to withdraw, but like the Germans in Stalingrad, they didn't.
The Arabs didn't just lack equipment, they lacked training. They were attempting to take cities, which they simply weren't capable of doing. The Arabs who had military experience had been conscripts in the Turkish army; they could follow orders, but didn't understand strategy. The British couldn't even beat the Turks themselves until they achieved a preponderance of force in Egypt. How exactly were they supposed to supply the Arabs with what they needed to conduct seiges of places like Medina, or Deraa? Heavily fortified, highly-defensible military outposts? Most of the supplies the Arabs received went through Yemen, which was a considerably-longer and more dangerous trip than to Alexandria, at least before the Arabs took Aqaba.
Lawrence recognised something that the Arabs should have worked out for themselves, but hadn't. Their strength didn't lay in seige warfare, or even their numbers. There were far more Arabs who either supported the Turks or didn't care one way or the other than there were rebels. The strength of the Arabs lay in their ability to launch hit-and-run raids and melt into the desert, where the Turks could not pursue them. In other words, classic guerrilla warfare. Bleed the enemy dry.
You also forget that Lawrence did indeed play a major role in uniting the Arabs. He had nothing to do with the initial revolt, but the success of Arabs in driving the Turks out of Arabia - due to Lawrence's instigation to attack the Hijaz railroad - inspired more Arabs to join the revolt. Some tribes which had originally been pro-Turkish even defected because of this. He was also instrumental in setting up the short-lived Arab Republic in Damascus, which collapsed due to the Arabs' inability to cooperate - though the British and French went out of their way to exacerbate the problem.
Regarding the film; it's a bloody-good film. Fantastic even. It's also woefully inaccurate, but that doesn't make the film bad as a film. Just bad as an historical film. And this is coming from the guy who can't bring himself to watch most historical films due to their dearth of accuracy.