ya but if you can't even manage 4k without being in physical agony then hiking 20km probably isn't a good idea especially considering you have no experience at all
want to lose weight quickly?
get a rucksack and fill it with sand/water jugs/bottles (you'll need drinking water anyways) and do that instead
you can walk 5km with a 10kg to start off with and see how you do
i suggest getting a good pair of shoes/boots to do it in, and to bring extra socks to change though
i need to do this again
couple of years ago i spent 2 weeks doing some hiking thing abroad
literally within about a week i'd lost more weight than i ever have before (paired with relatively small portions)
long distance hikes + weight (i had camping equipment + food w me) honestly worked fucking great
and yes make sure you bring extra socks, and dont wear shitty thin ones you'll hate yourself for it