Brazilian president modeled his political rise on his US counterpart's, but his eager endorsement of the Republican incumbent may now make him vulnerable at home