If i understand you correctly, if "the" (O/A etc) is in the beginning then mais takes the comparative form while if it is placed later in the sentence then it takes the superlative form
Just to get a clearer understanding
How would i say, "i want higher grades"? versus "i want the highest grades"?
O filme Rio é mais popular que o filme Verônica (comparative). O filme Rio é O mais popular (superlative). Eu quero notas mais altas (comparative), eu quero AS notas mais altas (superlative)