Yes, he did.
Based on footage that was shown at the SDCC Comic-Con (low quality copy here), Loki is seen presenting the Tesseract to a shadowy figure much larger than himself. A minute or so later, we see Thanos wearing a glove with a glowing blue stone embedded in the knuckle.
So either Loki recovered the Tesseract from the wreckage of Asgard before boarding Thor's ship (unlikely) or he took it from the vault when he walked past it (highly likely).
Studio head Kevin Feige left little to the imagination in an interview with Slashfilm
SF: And we also see Loki in that area. He walks by the Tesseract. When that planet blows up at the end, I assume that particular
Infinity Stone is not on that planet.
Feige: You were at Comic-Con, right? Did you see the Infinity War footage?
Yeah, and Loki had the cube in his possession in the footage.
Feige: The story I’m about to tell you is nothing about the mythology, just about filmmaking, I was just talking to Hiddleston
about this. When he shot that, he had the Surtur skull and he walked
by and he looked at [the tessaract] but then he kept walking. And he
left frame. And it was like that in the cut for a while. And nobody
remembered the moment. It didn’t register with anybody. So we recut it
so that Loki looks at it and then we cut away. When we showed that
cut, it registered with people who knew what it was. Did he take it?
He stopped, what does that mean? Which was exactly what we wanted the
audience to do.
Kevin Feige Answers Your Lingering ‘Thor: Ragnarok’ Spoiler Questions