Answer
Car: $50$ mph
Truck: $30$ mph.
Work Step by Step
distance = (rate)$\times$(time) $\Rightarrow$ time = $\displaystyle \frac{\text{distance}}{\text{rate}}$
Let x be the rate of the car.
The rate of the truck is $x-20.$
We are given: time = $\displaystyle \frac{300}{\text{rate of car}}$ = $\displaystyle \frac{180}{\text{rate of truck}}$
That is,
$\displaystyle \frac{300}{x}=\frac{180}{x-20} \qquad$ ... $/\times x(x-20)$
$300(x-20)=180\cdot x \qquad$ ... distribute...
$ 300x-6000=180x \qquad$ ... add $6000-180x$
$ 120x=6000 \qquad$ ... $/\div 120$
$x=50$ mph
... is the rate of the car, and the truck's is $30$ mph.