Use Bayes' rule:
P(Dep1|Rac) = P(Rac|Dep1)P(Dep1)/(P(Dep1)P(Rac|Dep1) + P(Dep2)P(Rac|Dep2))
where
P(Dep1|Rac): probability the state of the world is Dep1 given a racing car was selected--unknown
P(Rac|Dep1): probability a racing car is selected given the department is Dep1--0.25
P(Dep1): prior probability Dep1 is chosen--0.5
P(Rac|Dep1): probability of choosing a racing car given it is from Dep1--0.25
P(Dep2): prior probability Dep2 is chosen--0.5
P(Rac|Dep2): probability of choosing a racing car given it is from Dept2--0.5
Substituting and doing the arithmetic gives
P(Dep1|Rac) = 1/3.