TL;DR. The main point is that Tong only needs to identify the leading singularity in order to determine the Weyl anomaly
$$ \langle T^{\alpha}{}_{\alpha}\rangle~=~-\frac{c}{12} R^{(2)}. \tag{4.35} $$
Concerning OP's question it is indeed unclear how to properly account for subleading terms in Tong's approach. They are presumably either contact terms or vanish on-shell.
Let us introduce a regulator $\varepsilon>0$ in the $XX$ OPE
$$\begin{align} {\cal R} X(z,\bar{z})X(w,\bar{w})~=~&-\frac{\alpha^{\prime}}{2} \ln(|z-w|^2+\varepsilon)\cr
&+~: X(z,\bar{z})X(w,\bar{w}): \end{align}\tag{4.22}$$
to better identify the singular structure. The $\partial X\partial X$ OPE becomes:
$$\begin{align}
{\cal R} \partial_zX(z,\bar{z})& \partial_wX(w,\bar{w}) \cr
~\stackrel{(4.22)}{=}&~-\frac{\alpha^{\prime}}{2}\frac{(\bar{z}-\bar{w})^2}{(|z-w|^2+\varepsilon)^2}\cr
&~+~:\partial_zX(z,\bar{z}) \partial_wX(w,\bar{w}): ~.\end{align} \tag{4.23}$$
The stress-energy-momentum tensor is
$$ T_{zz}~~=~ -\frac{1}{\alpha^{\prime}} :\partial_zX\partial_zX:~.\tag{4.25} $$
The $TT$ OPE becomes
$$ \begin{align}
{\cal R}T_{zz}(z,\bar{z}) &T_{ww}(w,\bar{w})\cr
~\stackrel{(4.23)+(4.25)}{=}&~\frac{c}{2}\frac{(\bar{z}-\bar{w})^4}{(|z-w|^2+\varepsilon)^4} \cr
&-\frac{2}{\alpha^{\prime}} \frac{(\bar{z}-\bar{w})^2}{(|z-w|^2+\varepsilon)^2}:\partial_zX(z,\bar{z}) \partial_wX(w,\bar{w}):\cr
&+~\ldots. \end{align}\tag{4.28}$$
We next use the energy conservation
$$ \partial_z T_{\bar{z}z} + \partial_{\bar{z}} T_{zz}~\approx~0, \tag{4.36z}$$
which holds on-shell up to contact terms.
We calculate$^1$
$$ \begin{align} {\cal R}\partial_z T_{z\bar{z}}(z,\bar{z})
&\partial_wT_{w\bar{w}}(w,\bar{w}) \cr
~\stackrel{(4.36z)}{\approx}&~{\cal R}\partial_{\bar{z}} T_{zz}(z,\bar{z})\partial_{\bar{w}}T_{ww}(w,\bar{w})\cr
~\stackrel{(4.28)}{=}&~
\partial_{\bar{z}}\partial_{\bar{w}} \left[ \frac{c}{2} \frac{(\bar{z}-\bar{w})^4}{(|z-w|^2+\varepsilon)^4} +\ldots \right] \cr
~=~&\partial_{\bar{w}} \left[ 2c \frac{\varepsilon(\bar{z}-\bar{w})^3}{(|z-w|^2+\varepsilon)^5} +\ldots \right] \cr
~=~&\frac{c}{12}\partial_{\bar{w}}\partial_z\partial_w\partial_z\frac{\varepsilon}{(|z-w|^2+\varepsilon)^2}+\ldots,
\end{align}\tag{4.37}$$
which leads to the sought-for OPE
$$\begin{align}
{\cal R}T_{z\bar{z}}(z,\bar{z}) &T_{w\bar{w}}(w,\bar{w}) \cr
~\stackrel{(4.37)}{=}&~\frac{c}{12}\partial_z\partial_{\bar{w}}\frac{\varepsilon}{(|z-w|^2+\varepsilon)^2}+\ldots \cr
~\stackrel{(4.2d)}{=}&~\frac{c\pi}{12}\partial_z\partial_{\bar{w}}\delta^2(z\!-\!w,\bar{z}\!-\!\bar{w}) +\ldots .
\end{align} \tag{4.39}$$
Here we use the following representation of the 2D Dirac delta distribution$^2$
$$\begin{align} \delta^2(z\!-\!w,\bar{z}\!-\!\bar{w})~:=~&
\delta({\rm Re} (z\!-\!w))~\delta({\rm Im} (z\!-\!w))\cr
~=~&\lim_{\varepsilon\searrow 0^+} \frac{1}{\pi}\frac{\varepsilon}{(|z-w|^2+\varepsilon)^2}. \end{align} \tag{4.2d}$$
Now proceed as in Tong's notes. $\Box$
References:
- D. Tong, Lectures on String Theory; Subsection 4.4.2.
--
$^1$ Tong's trick (4.37) suggests another route: Let us instead consider the $\partial X \bar{\partial}X$ OPE
$$\begin{align}
\left. \begin{array}{c}
{\cal R} \partial_zX(z,\bar{z})
\partial_{\bar{w}}X(w,\bar{w})\cr\cr
{\cal R} \partial_{\bar{z}}X(z,\bar{z}) \partial_wX(w,\bar{w})\end{array}\right\}
~=~&\frac{\alpha^{\prime}}{2}\frac{\varepsilon}{(|z-w|^2+\varepsilon)^2}+\ldots
\cr
~\stackrel{(4.2d)}{=}&~\frac{\alpha^{\prime}\pi}{2}\delta^2(z\!-\!w,\bar{z}\!-\!\bar{w}) +\ldots. \end{align}$$
It is comforting that the regularization $\varepsilon>0$ correctly predicts that the leading singularity is a 2D Dirac delta distribution.
Then the $T\bar{T}$ OPE becomes
$$ \begin{align} {\cal R}T_{zz}(z,\bar{z})&T_{\bar{w}\bar{w}}(w,\bar{w})\cr
~=&~\frac{c}{2}\frac{\varepsilon^2}{(|z-w|^2+\varepsilon)^4}\cr
&+\frac{2}{\alpha^{\prime}} \frac{\varepsilon}{(|z-w|^2+\varepsilon)^2}:\partial_zX(z,\bar{z})\partial_{\bar{w}}X(w,\bar{w}):\cr
&+~\ldots. \end{align}$$
The leading singularity is given by double contractions, which are proportional to the square of the 2D Dirac delta distribution. This is ill-defined, cf. e.g. this Phys.SE post.
Nevertheless, let us now formally apply Tong's trick: Using the energy conservation (4.36z) leads to
$$ {\cal R}\partial_z T_{z\bar{z}}(z,\bar{z}) \partial_{\bar{w}}T_{w\bar{w}}(w,\bar{w})
~\stackrel{(4.36z)}{\approx}~{\cal R}\partial_{\bar{z}} T_{zz}(z,\bar{z})\partial_w T_{\bar{w}\bar{w}}(w,\bar{w}), $$
so that the sought-for OPE leads to the square of the 2D Dirac delta distribution as well
$$ \begin{align} {\cal R}T_{z\bar{z}}(z,\bar{z}) &T_{w\bar{w}}(w,\bar{w})\cr
~=~&\frac{c}{2}\frac{\varepsilon^2}{(|z-w|^2+\varepsilon)^4}+\ldots\cr
~\stackrel{(4.2d)}{=}&~\frac{c}{2}\pi^2\delta^2(z\!-\!w,\bar{z}\!-\!\bar{w})^2+\ldots. \end{align}$$
There might be a way to resolve the square of the 2D Dirac delta distribution, and argue that the leading singularity is instead given by the second derivative of the 2D Dirac delta distribution,
$$\begin{align} \frac{c}{12}\partial_z\partial_{\bar{w}}\underbrace{\frac{\varepsilon}{(|z-w|^2+\varepsilon)^2}}_{=\pi\delta^2(z-w,\bar{z}-\bar{w})}
~=~&\frac{c}{2}\underbrace{\frac{\varepsilon^2}{(|z-w|^2+\varepsilon)^4}}_{=\pi^2\delta^2(z-w,\bar{z}-\bar{w})^2}\cr
~-~&\frac{c}{3}\underbrace{\frac{\varepsilon}{(|z-w|^2+\varepsilon)^3}}_{=4\pi^2\delta^2(z-w,\bar{z}-\bar{w})^2},\end{align}$$
as in eq. (4.39), although we shall not pursue the matter here. $\Box$
$^2$ Note that there is a factor of 2 in Tong's definition of the 2D Dirac delta distribution, cf. the end of Section 4.0.1.