Termination resistors using bipolar transistors for RS-485?
The impedance should not vary with the length of the cable. It is a combination of the cable inductance with its capacitance:

From this article.
See also excellent answers here.
There are ICs with &quot;Activatable&quot; termination (such as LTM2881) but that is for connections that are not point to point.

Your proposed &quot;solution&quot; would just try to short the RS-485 lines to ground directly, not provide a controlled termination. And the 120R resistors are always connected. Also note that &quot;A&quot; is not Tx and &quot;B&quot; is not Rx. &quot;B&quot; is just &quot;A&quot; inverted.