(2)Whenever it appears that before an application can be made under this section, the ship in respect of which the application is to be made will have departed from India or the territorial waters of India, any proper officer may detain the ship for such time as to allow the application to be made and the result thereof to be communicated to the officer detaining the ship, and that officer shall not be liable for any costs or damages in respect of the detention unless the same is proved to have been made without reasonable grounds.