After pushing yourself past the threshold of labored breathing into the realm of gasping for air, your body tends to be starved for oxygen. As luck would have it, that oxygen is exactly what your body needs to be able to compete at any level of continued exertion and when its gone... the muscles get sore, tired, and in the end, non-responsive. Not good.
In my experience a simple remedy to rejuvenating legs that have just come off a hard training run or race is to take at least one day off (no more than 3) then run a comfortable distance (3-5 miles is good for a 5k runner) at an easy pace with a high turn over rate.
First, warm up for about 1 mile before you increase your turn over rate. Once sufficiently warmed up, pick up your turn over rate to where you are running about 160 to 190 steps per minute. An easy way to do this is to count out 80 to 90 steps per right foot strike to the ground. Once you feel the pace, maintain that for about another 1 to 3 miles then conclude the run with a 1 mile warm down.
The slower pace with faster strides will help you recover from the microscopic tears and trauma to the muscles and inflammation that are causing the soreness.
Ahhh, fresh legs.