Seriously? How would you feel if someone staying at your house has left two mattresses for you to dispose of? That is not fair to leave your disposed of items for someone else to move out of the apartment.
Also, be honest......would you want to sleep on a mattress that someone else left behind? Not me.
So, no, it is not okay to leave your unwanted items, regardless of what they are or how useful or valuable you may think they are, for someone else to deal with because you did not want to?
If I were your landlord and you left mattresses behind, to remove them would cost me the amount I take out of your security deposit.
Take them with you or dispose of them properly. If you really do not want to deal with them, put an ad on Craigslist.com...free mattresses. Someone will come and take them away if they are not disgusting.