It's the latter. Yes, they know they got last. To me, though, it doesn't make sense to award any medal to someone who doesn't do better than anyone. The medal is meaningless, at best.
Mind you, I'm completely on board with what I'd refer to as "commemorative awards" - things that are given simply for successfully participating in an event. They're nice mementos, and I have several. But if I went to a mud run and joined the competitive wave (many of them have those) and turned out to be the only over-50 competitor, I wouldn't expect to receive the gold medal for my class. I'd be happier if they said they'd use my time in the next younger class, or even the open class, to see if I'd place.
I'm sure there are some folks who would be upset about not receiving a medal if they were one of 3 competitors, even if they lost to both of the others. But I also don't really care. That feels like the same vibe as folks who gather meaningless MA ranks and "honors" and use them to talk themselves up. A competitive person is most likely driven either by the competition, itself, or by the prize/symbol given as a result of besting others in competition. I seriously doubt there'd be any substantial number of people complaining if a ruleset was used where you had to win against someone in order to receive any rank medal.