yes, it is possible.
In the Designer, open the menu Administration -> Infobase Parameters.
We need the "Passive session termination timeout" parameter (screenshot 1). The default value is one day.
You can set a shorter interval after which the suspended session will be closed.
To check, you can set the following values (screenshot 2). Run the program and in the 1C server console we see the following (screenshot 3).
If now we close the 1C application using the task manager (in this way we simulate the program hanging), then after 10 seconds the session will also be closed (screenshots 4 and 5).