4. C.

Given that $a$ and $b$ satisfy the condition $1 \leqslant \frac{b}{a} \leqslant 3$, hence $\frac{a+2 b}{2 a+b}=2-\frac{3}{2+\frac{b}{a}} \leqslant \frac{7}{5}$. When $(a, b)=\left(\frac{1}{2}, \frac{3}{2}\right)$, the equality holds.
4. If real numbers $a, b$ satisfy
$$
\left\{\begin{array}{l}
a+b-2 \geqslant 0, \\
b-a-1 \leqslant 0, \\
a \leqslant 1,
\end{array}\right.
$$

then the maximum value of $\frac{a+2 b}{2 a+b}$ is ( ).
(A) 1
(B) $\frac{5}{4}$
(C) $\frac{7}{5}$
(D) 2