What would happen in this case? If I understand correctly, the proxy will always forward the request but the last hop (before the UAS) will forward the request only if a connection is active?

correct.

 

If the last hop doesn't forward the request because no TCP connection exists, what happens? How the proxy will detect this situation?

It won't find any matching connection and won't try to establish a new one since you asked it to not. So it will just send a reply back to the registrar with an error. After receiving an error registrar in its turn can perform some smart actions like forwarding to a voicemail system.