I assume that $r(t)$ is continuous.
The idea is that, this Poisson process with time-varying parameter $r(t)$, as the limit of Bernoulli trial with time-varying probability of success, is memoryless:
For a generic finite partition $\mathscr{P}$ of $[0, T]$ as $\{[0,t_1),[t_1,t_2),[t_2,t_3) \ldots,[t_{n-1},T]\}$, let the $n$th cell following a Poisson distribution with a fixed parameter $r(t_n)$, so
$$P_{\mathscr{P}} = 1 - \underbrace{e^{\sum_{k=1}^n-r(t_k)(t_k-t_{k-1})}}_{\text{Probability of no accidents}}$$. So $P = 1 - e^{-\int_0^Tr(t)dt}$. Notice that the Riemann integral $\int_0^Tr(t)dt$ is the limit of a net indexed by the set of all finite partitions of $[0,T]$ with vanishing maximal length of cell with respect to number of cells. $f(x)=1-e^{-x}$ is continuous, so this limit preserves.