You need to distinguish between a purely financial calculation and broader considerations.
Well, obviously if the cost of your debt is < than the return you get from another investment, you'll be better off NOT repaying the debt but investing at the higher rate.
No point in paying down a loan at 1.5% if you can invest somewhere else at, say 2% (post tax).
That's in theory - in practice, can you? With ultra-low interest rates it's very hard to find safe investments (eg saving accounts) that yield more than the mortgage costs you.
There are people who intentionally do not repay as much of their mortgage as they can, and invest extra savings in riskier investments (e.g. the stock market); they are effectively betting that the return of the stock market will be higher. There is a decent chance (but no absolute certainty) of this happening in the medium to long term (7+ years) but, if you have an horizon of a couple of years, it's too risky.
In broader terms, you also have to think of how much the extra flexibility is worth to you. Once you put money in your house by paying down your mortgage, it's harder to borrow it again. If instead you leave it in a saving account, it's immediately accessible if you need it in an emergency.
Eg say you lose your job or you have to incur an unexpected expense (the car breaks down, problems in the house, whatever) - in those cases having easily accessible funds would probably be better.