Problem: The text declares that “these are the kings of the land whom the children of Israel defeated.” However, many of these cities were not captured until later (cf. Josh. 15:63; 17:12; Jud. 1:22, 29).
Solution: There is a difference between defeating a king’s army on the field of battle and later destroying his capital city. Once defeated in battle, the king and his remaining troops would retreat to their stronghold where it was much more difficult to root them out. Sudden victory and permanent vanquishing are two different things. So understood, there is absolutely no contradiction between these texts.