- Mortgage is borrowing money.
- Borrowing is like renting.
- Renting short term is cheaper than renting long term.
- If the rent rate is fixed but term is not, you want to "return" the rented money as soon as possible.
This means paying off the debt ASAP (even before it's due) to avoid paying interest. Sometimes, mortgages have an early payment clause that allows you to pay less than full interest if you pay ahead of time. Therefore, you should pay the full $4000 you get from rent towards your mortgage.
With this strategy, you will cover 48k of debt every year. Some of this will go to cover the scheduled payment, the rest will effectively remove the 2.5% APR of your remaining payments. Therefore, the part of this 48k that goes to covering a payment x years early is like an investment that will return 2.5% annually (may be less than 2.5% due to early payment fees) and has a fixed term of x years. I won't calculate the actual numbers here (unless you really want me to) because the calculation is tedious; one would use a mortgage calculator online. However, those tend to include also things like tax, which I assume don't apply in your hypothetical.
For how long should I take the mortgage? As long as possible? As short as possible?
As a pure hypothetical: As short as possible if you will have no other investments. However in reality you may not have the option of altering mortgage term, in which case you want the shortest one for which you can afford the monthly payments, and then overpay early on.
If you can invest in other things, you must ask yourself if you can do better than 2.5% annual return with the rent you have left over from required mortgage payments. If yes, then you must take the mortgage as long as possible, pay only the minimum payments, and invest all surplus rent to get the higher return.
In reality: Being a landlord, as well as any investment, has significant risk, requires non-trivial work and is subject to complex regulations depending on your locale. So it's not a simple decision. You also don't get to take the mortgage you want, you get to pick from the options that banks offer you.
As an aside, at 1.5M for 4k rent, you are shelling out 375k (you would pay even more, because you have to pay interest) for each 12k of annual rent. That's a buy-rent ratio of 31.25, which is among the highest in the US - it's between DC and Anaheim, CA. I question the wisdom of buying rather than renting is such renter-friendly market.