I've been doing marathons and many other types of races for quite some time. Any type of training is good for backpacking but the absolute best is......backpacking. Nothing else can simulate it.

Go out and hike with a backpack on. Preferably the exact same pack at the same weight you'll do your long hike with. Get your equipment dialed in early. You don't need to do this every day. But the weight of a full pack on your feet should not be something new to you when you start your long hike.

You asked for a recommendation on training hike length. A good answer to that is impossible without knowing your fitness level, age, how much weight you will carry, the terrain, etc. etc. Yes you said you were training for a marathon but some people do them in 3 hours while some people run them in 6 hours. Big difference.

Specific questions will get you more specific answers.
_________________________
If you only travel on sunny days you will never reach your destination.*

* May not apply at certain latitudes in Canada and elsewhere.