H=Hercules’ age now, A=Achilles’ age now.
Three years ago their ages were H-3 and A-3.
Also, H=A+12, so (A-3)/(A+12-3)=2/5,
(A-3)/(A+9)=2/5,
5A-15=2A+18,
3A=33, A=11 so Achilles is 11 years old.
(Hercules is 23. Three years ago they would have been 8 and 20, 8/20=2/5.)