Solution (source code)

= Solution

Put $X_t=g_t(x)-W_t$, $Y_t=g_t(y)-W_t$ and $D_t=Y_t-X_t$. Before $T(x)$, order preservation gives $0<X_t<Y_t$ and $D_t>0$. The common noise cancels from their difference:
$$
dD_t=\left(\frac2{Y_t}-\frac2{X_t}\right)dt
=-\frac{2D_t}{X_tY_t}\,dt.
$$
Since $D$ has finite variation, applying the <Itô formula> to $Z=Y/D$ gives the <SLE two-boundary-point ratio diffusion>
$$
\boxed{dZ_t=-\frac{\sqrt\kappa}{D_t}\,d\beta_t
+\frac2{D_t^2}\left(\frac1{Z_t}+\frac1{Z_t-1}\right)dt,\qquad Z_t>1.}
$$
With the strictly increasing clock $u(t)=\int_0^tD_s^{-2}ds$, the <Dambis-Dubins-Schwarz theorem> yields a <Brownian motion> $B$ for which the time-changed process obeys
$$
d\widehat Z_u=\sqrt\kappa\,dB_u
+2\left(\frac1{\widehat Z_u}+\frac1{\widehat Z_u-1}\right)du.
$$
The sign of the new <Brownian motion> has absorbed the minus sign above.

The <domain Markov property of a chordal Loewner chain> says that, conditionally on the past before $T(x)$, the mapped future is a fresh <SLE>. Its boundary marked points are $X_t,Y_t$. Hence
$$
\mathbb P(T(x)<T(y)\mid\mathcal F_t)=F(X_t,Y_t)=f(Z_t),\qquad t<T(x).
$$
Localize, for example, where $D_t\geq1/n$, $Z_t\in[1+1/n,n]$ and $t\leq n$. On each such stopped interval this is a bounded <conditional-expectation martingale>, and therefore a genuine <martingale>. No smoothness assumption on $f$ is needed for this argument. The exit calculation below identifies it explicitly.