This verse refers to the Lamanites who had attacked Ammonihah and presents that battle in a slightly different perspective than the account in Alma 16:8 which makes the Nephite victory seem more decisive. In contrast, here the Lamanites seem to retreat more than suffer defeat. I suspect that it is more accurate. The Lamanites were attempting to retreat when they were overtaken; and returning as quickly as possible with their captives was more important than fighting the pursuing army.
Alma 16:12 records three years of peace, following by another military clash in the fourteenth year of the judges. This battle, discussed in Alma 28, ended in the fifteenth year of the judges (Alma 28:9). This correspondence between the subsequent battle firmly places this reference at the time of the Lamanite retreat from Ammonihah.