Answer :

present ages of sita and ram are 12 yrs and 24 yrs respectively.
let x  years ago, ram's age be thrice as sita's age.
x years ago

ram's age = (24-x)
sita's age = (12-x)

now, ram's age = 3(sita's age)
(24-x)=3(12-x)
24-x=36-3x
-x+3x=36-24
2x=12
x=6
hence, 6 yrs ago, ram's age was thrice as sita's age 
present 
   sits=12
   ram=24

before x years
   sits =12-x
   ram=24-x
give:-  (12-x) *3=24-x
        -3x +36=24-x
       -2x        =-12
          x        = 6
 so, before 6 years, sits was 6 years old and ram 18
  so, then ram was three times older than sits