is it legal to use the ex-husband's name as surname for obtaining passport
NO
For Passport, you cannot use it.
Coz in passport you have to mention that you are single and you have to use your fathers surname.
it is no legal to use ex husband s surname as after divorce, the relationship comes to an end.