Attain means to accomplish or finish an activity successfully without any complications.
"James already attained legendary status on clash of clans."
Obtain means to get possession of an item, good, service. It can be related to the ability to acquire and procure desired items.
"I obtained the recent Drake's album at the stores earlier, it was cheaper than I expected."