Two months ago I signed up for one of the harder races in Switzerland: the Alpenbrevet, a 276km race with over 7000m of elevation. However, with a new job I have less time for riding and only two months ago I hopped on my bike maybe once a week.

Still, I signed up for the longest and hardest distance of the three racing options.
Finishing a race of that magnitude is not an easy goal, especially if your training capacity is mediocre at best.
However, although physical fitness is very important, what gets you really up the mountain, through nasty weather conditions and across the finish line is your mind!
Here are a few suggestions that help me get through tough challenges, even with less training:
Never doubt your success. You gotta be on the start line thinking that you will succeed. Any doubt will later, in tough times, knock on your mental door and question your sanity. During the first climb of the Alpenbrevet, all the different distance groups (Silver, Gold, Platinum) rode together. I asked a few riders what distance they will ride. A lot said `I will see. I was thinking of Platinum but if I do not feel well, I will go for the Gold distance`. All of them set themselves up for not completing the highest goal they could achieve.
Don’t focus on the pain. If you do it will only get worse. It`s the same with feeling sick. If you think about getting sick, you will. Distract yourself. Especially on long challenges, try to distract yourself with something else than your current activity. Sooner or later, you will find yourself thinking about it all the time anyway. Now, when it is easy to entertain yourself with other things, like chatting (if possible) with other riders, enjoying the nature, counting the white stripes of the middle lane, will make the latter and tougher part of the race mentally easier.
Tell as many people as possible about your goal. Because you would have to tell all of them you had to quit. Then try to imagine what you would tell them. If it sounds like an excuse, keep going.
Play worse-case scenario. If you are getting tired climbing up a mountain, ask yourself: How could it be worse? The grade could be steeper. It could rain. There could be headwind. It could be a cobble way. All of a sudden, your current condition does not seem too bad anymore.
After all it all boils down to:
Pain is temporary but failure lasts forever.
Plus, crossing the finish line after a very tough challenge is an indescribable addicting feeling.
What gets you through a tough race?