(Updates prices, adds details on Mexican peso) By Bruno and Federowski SAO PAULO, Jan 12 (Reuters) - Brazil's benchmark index remained flat on Friday to hew close to its recent record high, shrugging off a sovereign ratings downgrade by Standard & Poor's, while Mexico's peso gained on market optimism that key trade talks will continue. S&P on Thursday cut Brazil's credit rating deeper into junk territory as doubts grew about a presidential election in October and a push to trim its