'Different teams' isn't that much of a thing as people often like to believe at world championships. At least not when seeing national teams as by definition being different teams. A Belgian and a German can be closer teammates at world championships than two Spaniars, to give one nation that's famous for riding against each other as example.
Roglic wasn't going to win a sprint against Van Aert, possibly Alaphilippe (if they had caught him) and Kwiatkowski, all he could have done was help his teammate who did have a quick sprint. He just didn't have anything left in the tank anymore, nearly had to let go at two short attacks and his sprint was barely a sprint anymore, so it's only logical he didn't manage to pull on the lead for Van Aert.