Correct. By setting up this system of equations, you will be able to solve for t, the amount of time it will take the trains to pass each other.
Since the trains begin 50 miles apart, they will meet somewhere in the middle of the two stations. If Train A travels 50 - d distance then Train B will need to travel a distance of d so that the total distance traveled for the two trains is 50 miles, the distance that stations are apart from each other.