Given a locally integrable function $\gamma:\mathbb R_{\geq0}\rightarrow\mathbb R$ we define the continuuous, non-negative function $\Gamma(t):=\max_{u\leq t}\int_u^t \gamma \,\mathrm d\lambda$. $\Gamma$ can be interpreted as the length of a queue with flow rate $\gamma$.
I want to show, that $\Gamma$ is differentiable almost everywhere with $$ \Gamma'(t) = \begin{cases} \gamma(t), &\text{for $\Gamma(t)>0$,}\\ 0, &\text{otherwise,} \end{cases} $$ for almost all $t\geq 0$.
I could manage to show that $\Gamma'(t) = \gamma(t)$ for almost all $t$ with $\Gamma(t)>0$. I include the details for completeness, although they are not too relevant for the question:
We first show, that on closed intervals $[a,b]$ with $a < b$ on which $\Gamma$ is strictly positive, there exists a common $u\leq a$ such that $\Gamma(\theta) = \int_u^\theta \gamma \,\mathrm d\lambda$ holds for all $\theta\in [a,b]$. Let $u_a\in\arg\max_{u\leq a} \int_u^a \gamma \,\mathrm d\lambda$. We define $$\theta := \max\left\{\theta\in [a, b] \,\middle\vert\, \forall \theta'\in[a,\theta]: \Gamma(\theta') = \int_{u_a}^{\theta'} \gamma \,\mathrm d\lambda \right\}.$$ If $\theta = b$, the claim follows directly. If we assume $\theta < b$, there exists a sequence $(\theta_k)_{k\in\mathbb N}$ with $\theta_k\in(\theta,b]$, $\lim_{k\rightarrow\infty} \theta_k= \theta$ and $\Gamma(\theta_k) \neq \int_{u_a}^{\theta_k} \gamma \,\mathrm d\lambda$. By definition of $\Gamma$ we even have $\Gamma(\theta_k) > \int_{u_a}^{\theta_k} \gamma \,\mathrm d\lambda$. Moreover, this shows that $\Gamma(\theta_k) = \max_{u\in(\theta, \theta_k]} \int_u^{\theta_k} \gamma \,\mathrm d\lambda$, because for $u\leq\theta$ we have $$\int_u^{\theta_k} \gamma \,\mathrm d\lambda \leq \Gamma(\theta) + \int_\theta^{\theta_k} \gamma\,\mathrm d\lambda = \int_{u_a}^{\theta_k} \gamma \,\mathrm d\lambda < \Gamma(\theta_k).$$ Therefore, for $k \rightarrow \infty$ the value $\Gamma(\theta_k)$ converges to $0$. Because $\Gamma$ is continuous we derive the contradiction $\Gamma(\theta) = 0$.
What troubles me is to get the required result for almost all $t$ with $\Gamma(t) = 0$: The set $A:=\{t\mid \Gamma(t) = 0\}$ is closed by the continuity of $\Gamma$. On open intervals $(a,b)\subseteq A$, the derivative is clearly $\Gamma'(t)=0$, but I lack this statement for the boundary $\partial A$. I am unsure whether the boundary is relevant in my case, but there are closed sets with positive measure on the boundary (e.g. a Smith-Volterra-Cantor-Set).
Edit: I had a typo in the question: I previously said, $\gamma$ would be non-negative. In that case, Henry Bosch has given a very straight-forward answer in https://math.stackexchange.com/a/4311863/652841. Also for $\gamma\geq 0$ we have $\Gamma(t) = \int_0^t \gamma \,\mathrm d \lambda$.
We show, that $\Gamma$ is an absolutely continuous function on any interval $[\alpha,\beta]$, and force that $\Gamma$ is differentiable almost everywhere that way.
Lemma. $\Gamma$ is absolutely continuous on any interval $[\alpha, \beta]$.
Proof. For the most part, we follow the proof of the fundamental theorem of Lebesgue integral calculus as explained in [Theorem 4.4.1, 1].
As $\gamma$ is locally integrable, we have $\int_\alpha^\beta |\gamma| \,\mathrm d\lambda<\infty$. By [Proposition 2.5.8, 1] for any $\varepsilon > 0$ there exists $\delta > 0$ such that for any measurable set $A$ with $\lambda(A) < \delta$ we have $\int_A \gamma\,\mathrm d\lambda < \varepsilon$. Now, let $([a_i, b_i])_i$ be a finite sequence of p.w. disjoint intervals with $\sum_i (b_i - a_i) < \delta$. We have to show, that $\sum_i | \Gamma(b_i) - \Gamma(a_i) | < \varepsilon$.
Claim. For any $a < b$ we have $\Delta := |\Gamma(b) - \Gamma(a)| \leq \int_a^b |\gamma| \,\mathrm d\lambda$.
Proof. Let $u_a\leq a$ and $u_b\leq b$ both be maximal with $\Gamma(a) = \int_{u_a}^a \gamma \,\mathrm d \lambda$ and $\Gamma(b) = \int_{u_b}^b \gamma \,\mathrm d \lambda$.
In the case $\Gamma(a) \geq \Gamma(b)$ we have $$\Delta = \int_{u_a}^a \gamma\,\mathrm d\lambda - \max_{u\leq b} \int_u^b\gamma\,\mathrm d\lambda \leq \int_{u_a}^a \gamma \,\mathrm d \lambda - \int_{u_a}^b \gamma \,\mathrm d\lambda = \int_a^b -\gamma \,\mathrm d\lambda \leq \int_a^b |\gamma| \,\mathrm d\lambda. $$ Let us analyse the case $\Gamma(b) > \Gamma(a)$. In the case $u_b \leq a$, we can show $u_b = u_a$: If we assume $u_b < u_a$, we have $\int_{u_b}^b \gamma \,\mathrm d\lambda > \int_{u_a}^b \gamma \,\mathrm d\lambda$, which implies the contradiction $\int_{u_b}^a \gamma \,\mathrm d\lambda > \int_{u_a}^a \gamma\,\mathrm d\lambda$. Assuming $u_b > u_a$ we get $\int_{u_a}^a \gamma\,\mathrm d\lambda > \int_{u_b}^a\gamma\,\mathrm d\lambda$ by the maximality of $u_a$ and hence $\int_{u_a}^b \gamma\,\mathrm d\lambda > \int_{u_b}^b\gamma\,\mathrm d\lambda$ yields another contradiction. With this observation, we deduct $$ \Delta = \int_{u_b}^b\gamma \,\mathrm d\lambda - \int_{u_a}^a \gamma\,\mathrm d\lambda = \int_a^b\gamma \,\mathrm d\lambda \leq \int_a^b |\gamma| \,\mathrm d\lambda $$
Now, the case $\Gamma(b) > \Gamma(a)$ with $u_b > a$ remains. Here, we have $$ \Delta = \int_{u_b}^b \gamma\,\mathrm d\lambda - \Gamma(a) \leq \int_{u_b}^b \gamma\,\mathrm d\lambda \leq \int _a^b |\gamma| \,\mathrm d\lambda $$
$\blacksquare$
The claim above implies $$ \sum_i |\Gamma(b_i)-\Gamma(a_i)| \leq \sum_i \int_{a_i}^{b_i} |\gamma|\,\mathrm d\lambda = \int_{\bigcup_i [a_i, b_i]} \gamma\,\mathrm d\lambda < \varepsilon. $$
$\square$
Being absolutely continuous on any interval implies that $\Gamma$ is almost everywhere differentiable. This means, that $\Gamma$ is also almost everywhere differentiable in $A:=\{ t \mid \Gamma(t) = 0 \}$. As $\Gamma$ is never (strictly) negative, the derivative on $A$ can only be $0$, which concludes the proof.
References
[1]: "Measure Theory and Probability Theory", 2006 by Athreya, Krishna, Lahiri, Soumendra