In the map below you can see how far He traveled on foot from Capernaum to Nain. I looked it up online and it was 22 miles - by foot.
All this takes place before He is invited to dine at the Pharisee's house - we are never told where Simon's house is located, but regardless - He has been walking and serving for quite a distance before this invitation.