In general, a Jew is permitted to benefit from the melacha (forbidden Shabbat labor) a non-Jew does for himself or for other non-Jews.
R Daniel Braude (Learn Shabbos, pp. 521ff) writes that
- a Jew can benefit from a melacha performed by a non-Jew for himself (if there is no need for more melacha to benefit the Jew),
e.g., switching a light is fine as the non-Jew doesn't need more work
to benefit the Jew, boiling water is not as there needs to be more
water for the Jew
- a Jew can benefit from a melacha performed a non-Jew if the non-Jew doesn't know the Jew and the Jew is not visibly present at the
time of the melacha
- if it is unclear for whom the non-Jew did the melacha, it depends on who is present. If it is a majority of Jews, it is forbidden to
benefit, if the majority are non-Jews, it is permitted
- if it is clear the non-Jew performed the melacha for non-Jews, then Jews can benefit even if they are the majority
In your specific case, it appears permitted since the Jew is a minority in a group of non-Jews for which the melacha was performed.
These laws are discussed in Shulchan Aruch OC 325, see there with Mishna Brura. See esp. 325:10 as well as OC 276:1 and commentaries. In English see here and here.
Of course, consult your rabbi
before implementing anything you learn here.