Usually there should be sufficient block time in between these "direct" flights, but once in a while, there will be two flights in the air with the same flight number.
For example, UA498, preforming STL to DEN, and then DEN to PDX - on Saturday, April 20, 2024, STL to DEN was late, which resulted in two UA498 in the air for a period of time. I actually think the DEN to PDX flight waited a bit before taking off; though can't be absolutely certain:
STL to DEN: landing at 739pm; gate arrival 747pm
DEN to PDX: gate departure 709pm; take off 738pm