You are allowed to take up to 25K in cash form to foreign countries, but the issue I think is that mailing legal tender is not allowed in most countries. You can transfer money digitally or carry it in person without issues.
That was a one time exception because every bank outside india was told not to accept any indian currency. most of the international banks that did money transfer did not have the new currency with them and were not allowed to take back the old currency so people had no other choice than to mail back the extra money they had to india. Banks in nepal still are stuck with the demo'd old indian currency even today and rbi is not doing anything about it.
Edit: even in india, only nationalized bans were allowed money exchange. all those co-operative banks and private banks were not allowed to do such money exchange. i still have like one 500 rupees note even today because i could not change it back. is it illegal to still have the old currency? RBI says we can have 1-2 notes of these.