Step 1: Approach
Use the forces on the 12 kg block and the 2 kg block as a check.
Step 2: Acceleration
$a=\dfrac{F}{22}$ for the whole train.
Step 3: Block 12 kg
$F-T_1=12a$, so $T_1=F-\dfrac{12F}{22}=\dfrac{10F}{22}$.
Step 4: Block 2 kg
$T_2=2a=\dfrac{2F}{22}$.
Step 5: Ratio
$T_1:T_2=10:2=5:1$, option (B). The tension is larger nearer the pulling force because that string must accelerate more mass.
Final Answer:
The tension nearer the force carries 10 kg and the other carries 2 kg, so the ratio is 5 to 1, option (B).
\[ \boxed{5:1} \]