Hi and welcome to Just Answer!
The part of mortgage payment attributable to the interest may be deducted as rental interest expenses. The part attributable to principle is not deductible and it is not added to basis of a new property. The loan when you take it is not your income - so when you pay it off - it is not a deductible expense.
The demolishing is a disposition of the property - it will be written off - reported as a sale with the sale price equal to its remaining basis (if any) will be reported on the form 4797. Remaining basis (if any) will be added to the basis of land.
Demolition expenses are also added to the basis of land.
Please see for reference - http://www.law.cornell.edu/uscode/html/uscode26/usc_sec_26_00000280---B000-.html
In the case of the demolition of any structure-
(1) no deduction otherwise allowable under this chapter shall be allowed to the owner or lessee of such structure for-
(A) any amount expended for such demolition, or
(B) any loss sustained on account of such demolition; and
(2) amounts described in paragraph (1) shall be treated as properly chargeable to capital account with respect to the land on which the demolished structure was located
The actual cost for the replacement building will be a basis of a new property which you will depreciate going forward.
Let me know if you need any help.