There is a reason most enduros are a sea of orange
At 42, I decided to get back into off road riding after a 25 year break. I wanted to do some enduros, hare scrambles and dual sport rides but did not want to break the bank $. Some observations: in the woods, weight is your enemy no matter how it is distributed. An XR will feel much heavier than most bikes and is underpowered to boot. A 450 or larger motor is a handful no matter how you try to tame it down. If you were racing MX or desert it is the go-to model, in tight woods and rocks it is a liability.
A racing 4 stroke makes twice as much power as an XR but will require a higher maintenance level. Unless you know the history of a racing 4 stroke motor be prepared for a rebuild in the future. They can be expensive - like $2000 expensive when things go wrong. 250Fs get worked pretty hard to make power, eventually they need some attention.
I went with a 2005 KTM 250 EXC/XC-W (2 stroke) for my first 2 years of racing. It had been raced by the two previous owners and had all of the enduro gear installed including an ICO enduro computer. 2 full years of racing and no isssues with the bike. It is plated and I have done 10 dual sport rides with it. Deadly reliable and it will go anywhere and through anything. Last year I ponied up for a new KTM 300xc. After 16 enduros, 11 hare scrambles and 4 dual sport rides I gave it a fresh piston and rings, new brakes and tires and I am ready to go at a full season again including 2 nationals already. I ride tighter east coast singletrack in a mix of sandy terrain and hardcore rock racing.
I bought my 250 for less than half of your budget and did well with it. In the northeast US $4,500 should get you a 2009 or 2010 250 XCW or maybe a 300. The 2008 and newer KTMs use an updated chassis and some of them are electric start. I didn't think I would like E start but my 300s works flawlessly and button starting the bike in a mudhole or on the side of a hill makes life easier. 2009 and newer KTMs have better forks than older models. 2009, 2010 and 2011 XCWs are essentially unchanged so the bike condition should be the determining factor.
The senior (40+) class is open to all bikes so resist the temptation to go big. Most Vet and SR racers are on 250s 300s and 400s because of the weight/power relationship. A 125 is too tiring to keep on the pipe all day, but that is the only way it will be competitive.
Look for something that has been maintained and maybe has some extras - I use a steering damper and a Rekluse auto clutch both will make you smoother and faster with less fatigue.