Question: Joshua (8:28) says that Ai would never again be occupied after it was destroyed by Joshua. But Nehemiah (7:32) lists it among the cities of Israel at the time of the Babylonian captivity.
Response: Joshua 8:28 isn't talking about the future of the city of Ai, but rather the condition of Ai during the time in which Joshua 8:28 was written.
According to the NIV English translation of Joshua 8:28, the city of Ai was completely destroyed and it remained a "permanent heap of ruins, a desolate place to this day."
The reference to this day refers to the day on which Joshua 8:28 was written. At that point in time, more than 2000 years ago, the city of Ai was still a heap of ruins.