I do not have a way to assess their motivations or thoughts at that time. They did not have control of the Capitol -- ever. They were allowed to wander around rather than risk more injuries to themselves and police. The legislators and Pence refused to leave. They were not going to exit until they fulfilled their function. The military was about to intervene, there was tear gas, and Trump told them to leave. They were tired and out-of-shape. Come to think of it, you might be right about hunger being the main motivation in the crowd at that time.
Trump thought the politicians would be intimidated enough to flee - when they did not, there was nothing else to do but call off his dogs.