Looking at such cases, the same thing comes to mind that who is responsible for the safety of the train, is there no guard in the train. Actually every long distance train has a guard, it is RPF soldier. Apart from this, TTE is also in the train.
TTEs roam in the train continuously, while the guards also roam around. But if someone bothers you at night, then you can go to the S-1 coach of the train. Often it is the coach of the guard. If you need the help of TTE, then you will get help on D-3, D-5 and seven berths in express or mail in intercity.