Brazilian have a first name, for example Mary, the last name from their mother, let's say Smith and the last name from their father, for example Brown. So the child's name is Mary Smith Brown.
It is always like this: a first name, the last name from mom and last name from dad.
A middle name is optional some people have, some people don't. In Brazil you can name your child Mary Elisabeth Smith Brown or Mary Rose Smith Brown or just Mary Smith Brown.
Note that Smith and Brown are her surnames. Brazilian have two surnames one from mom, one from dad. Usually we just use the last one that is from dad in most situations. So our Mary would present herself as Mary Brown.