Step 1: Pick the right formula.
Both cars move with steady acceleration, so we use $s = ut + \tfrac{1}{2}at^{2}$, where $u$ is the start speed and $a$ is the acceleration.
Step 2: Write distance for car X.
Car X has $u=8$ and $a=2$, so \[ s_{X} = 8t + \tfrac{1}{2}(2)t^{2} = 8t + t^{2} \]
Step 3: Write distance for car Y.
Car Y has $u=4$ and $a=4$, so \[ s_{Y} = 4t + \tfrac{1}{2}(4)t^{2} = 4t + 2t^{2} \]
Step 4: They reach the end together.
Same start time and same finish time means the distances are equal: $8t + t^{2} = 4t + 2t^{2}$. This gives $4t = t^{2}$, so $t = 4$ s (we drop $t=0$).
Step 5: Put $t=4$ back in.
\[ s = 8(4) + (4)^{2} = 32 + 16 = 48 \text{ m} \]
Step 6: Read the answer.
The length of the path is $48$ m, which is option 2. (The same value comes if you use car Y.)
\[ \boxed{s = 48 \text{ m}} \]