1 a : the act of preferring : the state of being preferred b : the power or opportunity of choosing
2 : one that is preferred
3 : the act, fact, or principle of giving advantages to some over others
4 : priority in the right to demand and receive satisfaction of an obligation
5 : ORIENTATION 2b sexual preference

1 : the action of obligating oneself to a course of action (as by a promise or vow)
2 a : something (as a formal contract, a promise, or the demands of conscience or custom) that obligates one to a course of action b : a debt security (as a mortgage or corporate bond) c : a commitment (as by a government) to pay a particular sum of money; also : an amount owed under such an obligation unable to meet its obligations, the company went into bankruptcy
3 a : a condition or feeling of being obligated b : a debt of gratitude
4 : something one is bound to do : DUTY, RESPONSIBILITY

[M-W's Col. Dic.]

I don't understand the #4 definition of "preference". In my opinion the definition #4 of "obligation" is the one which is relevant here.

If I'm given preference, let's say, in buying railway tickets. Then, it would be said that I've been given priority in the right to receive satisfaction of my need/requirement/want, etc. "obligation" is much different from 'need', 'requirement', 'want', therefore using it doesn't make sense to me. Please help me.
I agree with Doctor D. His explanation is perfectly clear.

It might be a ruling by a bankruptcy judge, for example.
I've reviewed a different dictionary and I believe that #4 means preference in a financial situation. That is, the right to receive payment ahead of other creditors. The obligation is a financial obligation.
Site Hint: Check out our list of pronunciation videos.
 Avangi's reply was promoted to an answer.
Thank you, Doc D.