Basic idea
It would be interesting to explain the reason for the low speed of this type of logic gate (RTL), which led to their replacement with TTL. In my opinion, it is the presence of a base resistor connecting the output of the previous stage to the input (BJT base) of the next stage.
RTL vs TTL
It is interesting to examine and compare the input parts of the two types of logic gates families because they differ greatly in the way they are controlled.
RTL
Indeed, a base resistor Rb is required at the input of the BJT to limit the current. The problem here, however, is that the transistor is switched on and off through the same resistor.
Vin = HIGH: The base is charged by the output of the previous stage through Rb.
simulate this circuit – Schematic created using CircuitLab
Vin = LOW: The base (slowly) discharges through Rb and the bottom (turned on) transistor of the previous output stage.
simulate this circuit
TTL
In TTL only switching on is through a "pull-up" base resistor connected to the own power supply.
Vin = HIGH: The Q2 base is charged through Rb and the Q1's forward-biased base-collector junction (diode). The interesting thing here is that the input voltage source has a voltage but it does not drive Q2; the supply voltage does it through Rb. All this complexity is done in order to be able to connect the Q2's base to the ground directly and not through Rb when Vin = 0 (see below).
simulate this circuit
The Q1 base-emitter junction acts as an open switch that switches off the input voltage.
simulate this circuit
Vin = LOW: The switching off is done by shorting the input base-emitter junction. So the base (quickly) discharges through the Q1's collector-emitter part and the bottom (turned on) transistor of the previous output stage.
simulate this circuit
The Q1's collector-emitter part acts as a closed switch that grounds the input (Q2's base).
simulate this circuit
In this way, the transistor turns off quickly because the charge on its base is dissipated quickly.