How to stay motivated in a group with low motivation?
Flee or fight.

Flee is obvious. Fight means focusing on your goals and finding something rewarding.

I've experienced low motivation, I am at this precise moment suffering high temperatures and lots of noise, the work environment is very important and it will have a toll in your productivity (and your career) if it is not the right one.

The point is, either you leave to a better place (if possible, that depends on several factors) or if you decide to stay then you need to compensate from that toxic environment.

I read some time ago a blog post titled hack your motivation, which could be useful. In general what I find most motivating is keeping track of my progress, on a daily or even hourly basis, either writing a section of a paper, running/conducting an experiment, programming some class or complex method, or anything else. Anything that gives you the feeling of making some progress.

That's probably why your colleagues are wasting their time, games provide some fictional reward, some fictional and imaginary sense of achievement, games are like porn in that sense (no real sex, only fiction and imagination). What I mean, in short is: gamify your research. You all will be playing games, but you will be playing the right one (assuming you do the gamification right).

This site is a good example of gamification. I have 2093 points already! I would feel less sick with some A/C, though...

What you have to ponder are your chances in this flee or fight scenario. I can't tell you whether you will have more success running to a less toxic environment or reducing the toxicity for you. It depends on the opportunities that you can find to flee and how strong is your motivation and gamification to fight toxicity.

That's your decision and yours alone.