In everyday usage and American English, the terms are synonyms; however, per some dictionaries, a lawyer can provide legal advice and has been trained all about laws.
An attorney is legally permitted to represent people or act in their behalf.
Note: Some attorneys and lawyers use just the word Esquire before their names.