If I understand correctly the TCP roundtrip time can be used as a posteriori proxi for the order entry gateway delay.
So assuming the roundtrip time is composed of gate delay and independent other delays $RTT_g(t) = dT_g(t) + d_g(t)$ with assumed $Cov(dT_g,d_g)=0$ and $Cov(d_i,d_j)=0$. Minimizing the this combination of gate delay and other delays is leading to the same goal.
Perhaps a univariate modeling of this $RTT_g(t)$ based on historical observed observations is suitable. Could be that a simple rolling mean/median and (robust) dispersion metric is enough?
I found this http://www.eecis.udel.edu/~bohacek/Papers/paper579.pdf paper about video streaming and congestion. They estimate a Cox-Ingersoll-Ross model (https://en.wikipedia.org/wiki/Cox%E2%80%93Ingersoll%E2%80%93Ross_model) to estimate and predict delays.
$dRTT_g = a (b-RTT_g)dt+\sigma\sqrt{RTT_g}dW_t$ with $dW_t$ brownian.
for this CIR there exist close form solutions for predictions which are chi-square family. so something like $S(t)=\text{argmin}_g \hat{RTT_g}(t+1)$
Note that i dont know if these gateway independence assumptions are not too strong, and i wonder if the gateway delay is not also a function of e.g. ordersize or previous usage. Good luck!