"Maria is a teacher."
Both is correct. は is a topic marker and が is a subject marker. So, for example, if somebody asks "What does Maria do for a living?" the answer is マリアは先生です, but if the question is "Who is a teacher?", the answer is マリアが先生です (Maria is a teacher), because you're stressing the word before the が, aka the subject. So basically it depends on the conversation and what you're trying to say. You can read more about it here, here and here
The best way to explain it は is what is being talked about が is what is doing the action (both work in this case) を is what the action is being done to
In english, this would be
マライさんは先生です。As for maria, [maria] is a teacher
マライさんが先生です。Maria is a teacher
In the first example, maria is more in the context of the sentence, whereas in the second, you're more putting her forth since she is doing the action of being a teacher, but maria as a subject is still implied in the first since she is still doing the action of being a teacher.
Does that make sense?