Difference between $X_t = Y_t$ a.s. and $X_{\tau} = Y_{\tau}$ a.s. ($\tau$ a stopping time) for càdlàg processes $X,Y$? We work on a filtered probability space $(\Omega,\mathcal{F},(\mathcal{F})_{t\in[0,T]},P)$. Let $X,Y$ be two càdlàg adapted stochastic processes.
What is the difference between the following two conditions:

*

*$X_t= Y_t \enspace P$-a.s. $\forall t\in [0,T]$

*$X_{\tau}= Y_{\tau} \enspace P$-a.s. $\forall [0,T]$-valued stopping times $\tau$
Question: Which of the two conditions implies the other one, and are they even equivalent?
Partial answer: I think that 2. $\Rightarrow$ 1. holds. Indeed, if 2. holds, then for $t\in [0,T]$ fixed, defining $\tau(\omega)$ to be equal to $t$ for all $\omega$, yields that $\tau$ is a stopping time, and thus 1. holds.
What about the other direction, i.e. does 1. $\Rightarrow$ 2. hold?
Note: The same question under the assumption that $X,Y$ are làdlàg is discussed in this post. In this case 1. $\Rightarrow$ 2. does not hold. There is a counterexample in the accepted answer.
 A: Indeed, 2. implies 1. by the argument you have presented.

Now note the following:
Theorem ([1;Lemma 21.5]). Fix a probability space as you have done in your question and let $I\subset\mathbb R$. We will assume that the probability space is complete, i.e. that all subsets of null sets are measurable (though the reference given formulates this Theorem without this assumption).
If $X=(X_t)_{t\in I},Y=(Y_t)_{t\in I}$ are two stochastic processes taking values in some metric space $(E,d)$ such that $$\mathsf P(X_t=Y_t)=1$$ for all $t\in I$, then, if either

*

*$I$ is countable; OR

*$I$ is a connected set and $X,Y$ are almost surely right-continuous,

we have that $$\mathsf P(X_t\neq Y_t \text{ for some }t\in I)=0.$$

Let $I=[0,T]$ for some $T>0$. Then the Theorem is a non-trivial result because the event "$X_t\neq Y_t \text{ for some }t\in[0,T]$" is an uncountable union of the events "$X_t\neq Y_t$", and in general the uncountable union of null sets need not be a null set.

In any case, this shows that 1. also implies 2., because for any function $\tau:\Omega\to[0,T]$ (whether a stopping time or not, $\tau$ doesn't even need to be measurable), we have that $$\{\omega\in\Omega: X_{\tau(\omega)}(\omega)\neq Y_{\tau(\omega)}(\omega)\}\subset\{\omega\in\Omega:X_t(\omega)\neq Y_t(\omega)\text{ for some }t\in[0,T]\},$$ so that by completeness of the probability space, $$\mathsf P(X_\tau\neq Y_\tau)=0.$$ If the probability space is not complete, you may run into trouble with non-measurable sets appearing.

Literature
[1] Achim Klenke, Wahrscheinlichkeitstheorie. 3. Auflage. Springer-Verlag Berlin/Heidelberg (2013).
