1)
What do we learn from "He'erichu Yamim"?
1.
Rashi (from Shabbos 105b): Their days were lengthened, but not their years. This was a punishment [for not eulogizing him properly].
2)
Why did the people serve Hashem all the days of Yehoshua and the Zekenim?
1.
Radak: It is because [the people] saw the miracles that Hashem did - splitting the Yarden, stopping the sun, and defeating the kings.
2.
Ralbag, Malbim: Because the Zekenim saw the miracles that Hashem did, they led the nation properly.