Both the term "barrio" and "barangay" refer to basic political units in the Philippines. Prior to the arrival of the Spaniards in the country, the term barangay was used by Filipinos when referring to independent villages, but during and after the Spanish rule, the term barrio (a Spanish word) became popular in lieu of the term barangay.
However, in 1974, President Ferdinand Marcos signed Presidential Decree No. 557: Declaring All Barrios in the Philippines as Barangays, and for Other Purposes.
Consequently, Republic Act No. 3590 otherwise known as the Revised Barrio Charter was adopted as the Barangay Charter, and the other terms also followed such as "teniente del barrio" to "Barangay Captain".
This is the reason why it is common to encounter the term barrio in the published history of the provinces, cities, and municipalities in the Philippines that were created before 1974.