I once had a tight transit on HKG-YVR-SEA on AC due to a delay in the first flight. Once I let the FA know, they moved us towards the front before descending and let us get off as soon as the door was opened. That was critical as we got ahead of other people for the US immigration and custom.
I just had that again with QX on SEA-YVR transiting to JL on YVR-NRT-HKG. They moved all the pax that had a tight transit to the front and also asked other passengers to let them get off first.
Once you make the FA aware of the situation, they normally will do anything they can to help, especially for KA and CX. The CX ground crew standing outside your KA arrival gate can always intercom the LAX gate about your status (and can hold your flight if necessary), take you through expedited security checkpoint, etc. Their ground support is really one of the best.