Aidan of this parish trains for far longer than that. His Strava profile is eye opening
I’m training for rides that may involve >24 hrs continuous and/or many 16 hour days back to back.
My rationale is that for a single 24 hr race you can burn yourself right down to nothing and cross the line on empty then sleep for a week. When you’re in remote back-country and you put 24 hrs to grab the lead, you need to be able to do that and then get up the next day to keep the lead and not get yourself needing rescue.
Proper 24 hr racers train for shorter, more intense periods than me. They weigh less and go faster than me.
If I were to advise the OP, I’d say it’s useful to properly trash yourself on a training ride once to know what it feels like. Not good on a regular basis, though.
You should be training (in no particular order):
Your heart + lungs (road is more efficient for this, I don’t like it, though, so stick to MTB myself)
Your contact points + joints (the bike you’ll race on is best for this)
Your stomach (eating/drinking enough is a skill)
Your brain (completely personal: first time I rode through the night was in my first 24 solo)
Your muscles (important if you ride singlespeed, otherwise it’ll take care of itself)
Your enjoyment (go mountain biking somewhere fun regularly or you’ll just hate riding)