Doing an action to sacrifice one for the sake of many is the trolley problem. How is this not that? We would knowingly infect a small number of people in order to save a (much) larger group.
The trolley problem is about the ethics of making a choice to intentionally kill someone to save others from guaranteed death. In this case it is the participants themselves making the choice. Additionally it is no guarantee they will be harmed, and no guarantee they will save others.
In other words, trolley problem is completely irrelevant here.