To analyze the system, we form the augmented matrix:
$\left( \begin{array}{ccc|c} 1 & 1 & 1 & 6 \\ 2 & 5 & a & 36 \\ 1 & 2 & 3 & b \end{array} \right)$
Apply row operations $R_2 \to R_2 - 2R_1$ and $R_3 \to R_3 - R_1$:
$\left( \begin{array}{ccc|c} 1 & 1 & 1 & 6 \\ 0 & 3 & a-2 & 24 \\ 0 & 1 & 2 & b-6 \end{array} \right)$
Swap $R_2$ and $R_3$ to simplify elimination:
$\left( \begin{array}{ccc|c} 1 & 1 & 1 & 6 \\ 0 & 1 & 2 & b-6 \\ 0 & 3 & a-2 & 24 \end{array} \right)$
Apply $R_3 \to R_3 - 3R_2$:
$\left( \begin{array}{ccc|c} 1 & 1 & 1 & 6 \\ 0 & 1 & 2 & b-6 \\ 0 & 0 & a-2 - 6 & 24 - 3(b-6) \end{array} \right)$
Simplifying the last row gives:
$\left( \begin{array}{ccc|c} 1 & 1 & 1 & 6 \\ 0 & 1 & 2 & b-6 \\ 0 & 0 & a-8 & 42 - 3b \end{array} \right)$
For infinitely many solutions, the rank of the coefficient matrix must equal the rank of the augmented matrix, and both must be less than the number of variables (3).
This requires the entire last row to be zero.
$a - 8 = 0 \implies a = 8$.
$42 - 3b = 0 \implies 3b = 42 \implies b = 14$.