There are several Brazilian municipalities that have the same name, I thought they were few, but the check the list of all of them , I saw that there are many cases. I think the worst case is Bom Jesus, the name of a municipality in Piauí, Rio Grande do Norte, Paraíba, Santa Catarina and Rio Grande do Sul. Arapuá (MG) and Arapuã (PR).
However, a state can not have two municipalities with the same name and not two municipalities that only differ in accentuation. So if you can get the name or acronym of the state of each municipality and concatenate the name, each municipality name will be unique.
There may be differences in case, accents, and apostrophes. For example, a base can give you " Waterhole of the Cunhãs (MA) " and the other " DAGUA OF THE CUNES (MA) ". In this case you convert everything to uppercase, strip the accents and take the apostrophes to unify the name.
So, if you can get the name, acronym or state code along with the name of the municipality from the bases, then just list the names of the counties together with the states for you to do this mapping [solution 1] .
If you can not get the name, acronym or state code directly, it may be part of the county code. For example, the first two digits of the municipality code used by IBGE on the bases I know are the same digits of the state. I do not know what the SNIS data you're using is, but I think it's just the IBGE municipal code without the last digit, because at least that's what I found when looking for some files to download from the SNIS website. p>
Disregarding the last digit of the IBGE code is safe, since this is just a check digit. From what I found in the spreadsheets I found on the SNIS website, that's exactly the case. For example, the municipality of Americana has the IBGE code 3501608, and in the spreadsheet that I found somewhere in the SNIS website is code 350160. In both cases, 35 is the state code of São Paulo. In this case, just disregard the last digit of the IBGE code and the codes will match. [solution 2]
If your code is anything that does not have similarity to the IBGE code and you do not have the state information available directly, then you should still try to find a pattern that from the code you discover the state . If this pattern does not exist, then you dance, for in this case you will not be able to know who is who in the case of Bom Jesus, for example. However, I find it unlikely that the base of the SNIS you are using will link the municipality without reporting anything at all about the state in question.