here train is moving in upward direction on an inclined plane having angle of inclination = 30 deg.
acceleration of the train = a = g/2
here component of acceleration in upward direction i.e. normal to the horizontal is (g/2)sin30 and along the horizontal it is (g/2)cos30
let string makes an angle

with the normal to the celing of train.
Tension in the string = T
Resolving the tension along two components as follows:
(a) Vertical to the ground
T cos(

- 30) = m[g +(g sin30)/2] (1)
(b) Along the ground that is in the horizontal direction
T sin(

- 30) = mg (cos30)/2 (2)
Dividing eq. (2) by (1) we obtain,
tan(

- 30) = [mg (cos30)]/m[g +(g sin30)/2] =

3 /5
or (tan

- tan30)/(1+tan

tan30) =

3 /5
or tan

= 2/

3
or

= tan
-12/

3
Now to obtain tension in the string square and add then equate LHS and RHS of eq. (1) and (2)
by doing so we obtain and simplifing we obtain
T = 5

7