It could be that you need to dig in mentally. It's very easy to lose focus during a race. My last 10k was like that, I was running alone and just forgot that I was racing for a while. It happens most when the terrain is a bit uneventful. I like a few ups and downs to keep the interest.
Try talking yourself around the race, keeping up with the runner in front, or passing the runner in front if they are slowing down a little.
If you want to do any kind of training to help then try running at a steady speed, say your 10k pace for 3 mins, then speed up for 30 secs then drop back down to your 10k pace for 3 mins etc.
Another you can do is an out and back run. Run hard for 3 mins then rest for 90 secs - say jog for 45 secs turn around and jog for 45 secs back to where you finished your 3 min run then run hard for 3 mins maintaining the same pace that you ran out on. You should end up where you started.
These will help you maintain pace and adjust your pace if need be. Speeding up and slowing down is easy on undulating terrain but a lot harder on the flat. Try it.
During a race watch the mile marker or k markers and keep an eye on your timimng. Make sure that you are pushing yourself throughout the race. I talk to myself, I ask how much is it hurting, can I push a little more etc. Keep the narrative up, hard if your running for a long time and swtch off, I've done that so often but worth doing.