I'll offer a (weak) guess based on the fact that you mention Heinlein specifically and no other answers have been commented on/accepted.
Could it be Time for the Stars? While the main plot is really different from what you are describing, I feel it's worth mentioning.
... has built a dozen exploratory torchships to search for habitable planets to colonize. The vessels can continually accelerate, but cannot exceed the speed of light, so the voyages will last many years.
And at the end of the story:
Shortly after he notifies Earth of the dire situation, they are surprised to hear a spaceship will rendezvous with them in less than a month and surmise it must be a more advanced LRF spaceship. Scientists on Earth have discovered faster-than-light travel, in part due to research into the nature of telepathy, and are collecting the surviving crews of the LRF torchships.
There are definitely details that don't match your description:
- The faster colonists didn't beat them, rather rescue them
- The slower-than-light vessels are generation ships
But the general theme of "...technology advances and a faster rocket ship is built [during the journey]..." is still present. It is the plot device used for resolution of the novel.