Professor refusing to write recommendation letter to make student work longer
Your professor is not obligated to write you a recommendation letter.
You should think about getting a letter from someone who will write a good recommendation for you.
Your professors' attitude is highly unprofessional and needs to be exposed to their academic community. When you're clear, file a complaint through proper channels to the dean/HOD. If possible, keep any record of your conversations/emails with the faculty members. Given the fact that such unprofessional behavior exists in your university (that they will ask you to work for them for 1-2 years after graduation as a condition for a recommendation letter), may be the human resource, dean office etc. themselves are unprofessional. So, tread carefully if you plan to expose their behavior. Maybe do it after you have received your degree etc. However, such behavior needs to be exposed in any academic institution for the sake of future generations.
If your foreign university asks (e.g., in future) why your own advisors didn't write you a recommendation then there is no harm in telling the truth. However, tell only the truth not your version of the truth. It's common for students at a certain phase in their career to panic, act hysterically, and believe that everyone is out to get them.