prosecutor: a government official who conducts criminal prosecutions on behalf of the state
lawyer: a professional person authorized to practice law; conducts lawsuits or gives legal advice
synonym: two words that can be interchanged in a context are said to be synonymous relative to that context