How many days pay is credited to your a/c?
Give a polite reply to show cause notice explaining the emergency and seek relief.
Attach copies of mails sent to HR and clearly mention lack of response from HR or your direct head.
They will not go to court or take legal action on such issues, especially since you are ready to repay salary credited to your a/c.( my personal opinion based on what you have written)
How did they do such a thing?
Is there a system of attendance?
If there is attendance records and still they have paid you, it is a mistake from their side and they are trying to cover up by talking of legal action.
But one thing which you could have done is to have sent a letter by speed post after reachig native place and that would have been proff of your contacting them and asking for exit.
Nothing to worry. As you have worked only for 4 days and also willing to give back the salary credited, there will be no legal implications.
Only thing is that you could have submitted proper resignation with your Superior and could have followed proper exit process which could have avoided all these process. You have not mentioned whether you have signed any agreement (training agreement /indemnity bond). Even in that case company has to prove the monetary loss incurred due to your absence.
In future always discuss with your superior /HR when you were not able to continue for what so ever reasons it may be. Vanishing from duty one fine morning without any information is not a good practice.
I have not taken any training during those day. Even I have not signed any agreement or bond to the company. If there is not project form me in the company, for the technology I was hired for, then there should be no any monetary loss.