And back to batteries and dynamos ... although all my road bikes have dynamos (well, I have two dyno wheels, one black one silver, and swap as necessary for colour-coordination), my MTB does not. I simply don't go fast enough when I'm riding it in Wales — there's no point riding it in the bit of England where I's live. I have been VERY impressed with these cheap lights off Amanoz —
https://www.amazon.co.uk/gp/product/B0765SV34Z/Gives about 7 hours on low-setting, which is actually more than enough light for relaxed road-riding, certainly in a group. And costs less than a tenner. And doesn't weigh enough to worry about.
I also use it riding forest trails in Wales, although I do tend to ride with a Blackburn Super Flea augmented with a Cree monster on my helmet for the technical bits.
The technology has all greatly moved on from when I had a mahoosive Specialized halogen light with four C-sized batteries to power it. If I was starting again from scratch, I would definitely consider just battery lights and a power pack. It's only cuz I already have dyno wheels that I'll keep using them — and the light I get from my IQ2 Cyo is superb.