A very difficult situation and one that was bound to provoke a conscientious person into soul-searching reflections. A couple of questions. Would this have been a battle worth fighting? In the course of a working day there are sure to be injustices that we come across. It’s not feasible or a fixed moral obligation to fight all of them. “Pick your battles.” Keeping quiet until you’ve had time to think isn’t always the worst option.
However, if speaking up does seem to you to be the right thing, also consider: how could this be done in proportion to the situation? There’s a range of things that could be said and modes of saying them, from light humour to outraged indignation. Your role as an employee comes into play, as well as confidence in your communication skills and ability to stay calm under pressures. These skills and abilities develop over time, so your best response a year from now might be a lot better than this time, when you were caught off guard.
Of course you know this stuff already, but I felt like offering some thoughts out of empathy for your dilemma.