They will also both have to pay child support of 30 per cent of the minimum wage in Brazil, which equates to NZ$88 a month.
"It was clear they each used the other's name, either to attract as many women as possible, or to hide betrayal in their relationship," the judge said.
The mother reportedly thought she was in a relationship with Fernando, whom she'd met through a mutual friend at a party.
"He told me he had a twin brother, but I did not get introduced. At the time I did not suspect anything," she told media in Brazil.
"One of the brothers, in bad faith, seeks to conceal fatherhood," the judge said.
"Such behaviour, of course, should not receive a guarantee from the judiciary which, on the contrary, must repress clumsy behaviour, especially in the case in which the defendants seek to benefit from their own clumsiness.
"Given the peculiarities of the case, I believe the decision that most embodies the concept of justice is the one that honours the interests and rights of the child, to the detriment of the tortuous defendants."