To find out how long it will take for the two trains to meet, we can start by determining their combined speed.
The speed of the train from A to B is 60 mph, and the speed of the train from B to A is 45 mph. The combined speed of the two trains is:
\[ 60 \text{ mph} + 45 \text{ mph} = 105 \text{ mph} \]
Next, we know the distance between the two towns is 420 miles. To find the time it takes for the two trains to meet, we can use the formula:
\[ \text{Time} = \frac{\text{Distance}}{\text{Speed}} \]
Substituting the values, we get:
\[ \text{Time} = \frac{420 \text{ miles}}{105 \text{ mph}} = 4 \text{ hours} \]
Therefore, it will take 4 hours for the two trains to meet.