“all the inhabitants of the land...will surround us.” Joshua understood that the inhabitants of the land would form a coalition to defend themselves, which they did. Joshua was no doubt hoping to come against the people city-kingdom to city-kingdom, but that made no difference to God.
“And what will you do for your great name?” Here, Joshua is interceding like Moses (cp. Exod. 32:11-14, 32-35; Num. 14:13-19). Joshua understood the fact that when Yahweh chose Israel and made a covenant with them that He was binding Himself to Israel, and Joshua used that connection as leverage when he prayed. Joshua has a genuine concern for both Israel and Yahweh.