The comparison isn't really valid as infantry was a lot more flexible tactically in terms of taking advantage of terrain and supporting arms, not to mention they are far easier to command and coordinate, resulting in what basically amounts to modern day infantry tactics which haven't changed that much since then, you could not do that with cavalry based infantry.
The thing is what did cavalry (Horse Mounted infantry) and the majority of Foot infantry evolve into?
Motorised and Mechanised Infantry - operating with integral Wheeled or tracked Transport form the majority of today's armed forces - why? Because its the quickest (and often safest) way of getting around a battlefield.
Even 'light' infantry formations use Helicopters to move around and on occasion have been known to jump en mass out of perfectly serviceable aircraft into a potential battlefield rather than walk!
In 1914 a mounted Cavalry man was 'no less' an Infantry man once dismounted as a modern Paratrooper or Guardsman or Marine is once 'they' are dismounted from their transport of choice and equally able to exploit terrain and supporting arms as any 'foot' infantry formation can once they have done so - they are just a lot faster and can cover a greater area of a given battlefield.
At the same time Horse mounted infantry that is engaged by Rifle MMG and Artillery fire while mounted is not any more vulnerable than a given Infantry formation in column of march or a horse drawn Artillery Regiment in 'Harness' . Which is why all 3 tended not to do so if knowingly in range of the enemy if they could at all help it!
Had allied Cavalry not existed in WW1 then there are several Battles where the German Army might have broken through as foot Infantry would have been too slow to react.
Basically considering Cavalry to be useless in the face of then modern weapons and trench warfare ignores how they were supposed to be and in many cases where used
In WW1 its easy to say that 'Command and Control' was not good enough to make use of that speed advantage - the very same is also true of Infantry and Artillery once the battle became 'fluid' (many many examples of Commanders having no clue where their subordinate Infantry and artillery units where - sometimes for days) and it was only towards the end of the war that the Principle armies learned how to better control the various arms.