Step 1: Write the given points.
The two points are:
\[
A(3,5,-1), \quad B(6,3,-2).
\]
Step 2: Use parametric form of line.
A general point \( P \) on the line joining A and B can be written as:
\[
P = (3 + t(6-3),\ 5 + t(3-5),\ -1 + t(-2+1)).
\]
\[
= (3+3t,\ 5-2t,\ -1-t).
\]
Step 3: Use the given condition.
Given that the \( y \)-coordinate of point \( P \) is 2, so:
\[
5 - 2t = 2.
\]
Step 4: Solve for \( t \).
\[
5 - 2t = 2 \Rightarrow 2t = 3 \Rightarrow t = \frac{3}{2}.
\]
Step 5: Find the \( x \)-coordinate.
Substitute \( t = \frac{3}{2} \) into \( x = 3 + 3t \):
\[
x = 3 + 3\left(\frac{3}{2}\right).
\]
\[
x = 3 + \frac{9}{2}.
\]
Step 6: Simplify the expression.
\[
x = \frac{6}{2} + \frac{9}{2} = \frac{15}{2}.
\]
Step 7: Final conclusion.
Thus, the required \( x \)-coordinate is \( \frac{15}{2} \).
Final Answer:
\[
\boxed{\frac{15}{2}}.
\]