Start by giving each of the unknowns a name, say,
FS = speed of the freight train, FT the time for its journey.
ES = speed of the express train, ET the time for its journey.
Choose other letters or names if you prefer, but it helps if you can choose names suggestive of what they represent.
Put the information that you are given in terms of your chosen names.
FT = 300/FS,
ET = 280/ES,
FT - ET = 2, etc.
Having done that, solve the equations.
(Doing that gets you to a quadratic, but that does factorize easily.)