Let the speed of the car A starting at station a be a, and the other car's (B's) speed b.
Both cars leave their stations going in the same direction. B meets A after travelling 9b km. A travels 90+9b km because the stations are 90 km apart.
We can write 90+9b=9a, because we know that A travels at a kph for 9 hours.
When the cars are heading towards one another, A travels 9a/7 km while B travels 90-9a/7 km from station b.
We can write 9b/7=90-9a/7, because B travelling at b kph covers a distance of 9b/7 km.
Multiply this eqn through by 7: 9b=630-9a.
We can divide both eqns through by 9: 10+b=a and b=70-a. Substituting this value we get 10+70-a=a, so 2a=80, a=40kph and b=30kph.