There will be physical labor to get done. For a few decades at least until someone figures out the roomba of automatons.
So there must be some labor force. It will just be a much larger unemployed and underemployed contingent. And with extreme overabundance, horrible downward pressure on wages.
And so what labor remains gets squeezed, and the rest battle for the job of garbage man, or babysitter.
Honestly real economies have many factors, but I'm really just saying that absent controls, the system by design approaches a hellscape at lightspeed.
The real ethical question here is, is there only one round of trolleys?
Because if this is a one and done question, then obviously I go for the one person.
But if it's possible at any point somebody comes along and has to run the experiment again after me, then if I leave an infinitely expanding number on one side, all it would take is one sadistic person to wipe out a incalculable amount of life.
In which case, I take the track with two people. And again, it is a question of repetition whether or not doing it once means that it won't happen next time or if this will continue with every cycle.