These are near synonyms. "Obligatory" is used when there is some form of contract, formal or informal, possibly just a social norm; you are necessarily required to do it, but people will talk about you if you don't. "Mandatory" is used when something must be performed, possibly under threat of legal action or compulsion.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.