TL;DR
It really isn't important to be the best,
as most people in the world aren't the best at their jobs,
and yet many of them can choose to be happy about it.
My story
I empathize with you because when I was a PhD student,
just as you did, I had dreams of grandeur.
I would publish amazing papers,
get a job in one of the best universities,
give amazing talks, etc.
Unfortunately, my dreams didn't come true.
My PhD research projects did not go as smoothly as I wished,
and I graduated one year later than I had planned.
Nevertheless, I did graduate and find a tenure track job.
Along the way, I got married and had kids.
Being a father has changed my priorities,
and I would say that I realized that contentment
is much more important than achievement.
What do I mean?
A billionaire could still feel unhappy because he/she wants more,
on the other hand a homeless person could be full of joy
because he/she is grateful for what he/she has.
Why am I content?
I am content because:
- I enjoy my research
- I am reasonably good at my research
- I and some other people find my research meaningful
- I am paid reasonably well for research and teaching
My advice for the OP
Paraphrasing what you wrote:
The grad students who work in my current choice of research area... are all from amazing institutes around the world and had been the brightest kids in their colleges, the ones with medals in olympiads, top Putnam scores, etc. I am from a mid-tier college in my country and never won an award for excelling in math/algorithms.
In my opinion,
you shouldn't be too hard on yourself
that you didn't take part in olympiads.
I say this as someone who did get a medal in an olympiad (the IMO).
In fact, someone who got a PhD from the same institution as myself
is a much more successful in math-related research than I am,
even though he did not take part in any olympiads.
(I suspect he probably would have been good at the olympiads,
but he just never knew he was good at math until he got into university.)
I would say that to succeed at olympiads,
you need to be smart and work hard,
but you also need to grow up in an environment
where you are exposed to information about olympiads
and you need to have the opportunity to train for them.
I would use the analogy that earning a medal at an olympiad
is like being certified to have a high IQ score ---
it suggests that you could do high-quality math/CS research,
but it definitely does not guarantee
that you will do high-quality math/CS research.
In short, my advice is:
Don't look at your competition,
how many awards they are winning,
how many papers they are writing,
just do your best to work with your awesome advisor,
and to do the best research and write the best papers that you can!
Related:
In a separate answer,
I explain how you do learn some problem solving skills
in your preparation for the IMO,
however, real academic research in math or theoretical computer science
is quite different from olympiad math.