They don’t have it with them.
In the books, the Invisibility Cloak gets dropped at the base of the Whomping Willow. Snape picks it up, and uses it to sneak up on the people in the Shrieking Shack:
“I found this at the base of the Whomping Willow,” said Snape, throwing the cloak aside, careful to keep this wand pointing directly at Lupin’s chest. “Very useful, Potter, I thank you….”
— Chapter 19 (The Servant of Lord Voldemort)
In all the kerfuffle with Pettigrew, nobody picks up the Cloak to bring back to Hogwarts. Instead, it gets returned by Lupin as he’s packing to leave:
“Here — I brought this from the Shrieking Shack last night,” he said, handing Harry back the Invisibility Cloak.
— Chapter 22 (Owl Post Again)
I don’t have the films to hand, so I can’t remember if/how this is addressed in the film canon.