Sometimes you can get a treasure card from some of the houses if you visit them - the ones with "extra" things you can click on, such as the plant levers in the Botanical Gardens, but otherwise, you might be out of luck. I've also had this problem, and I think it's ridiculous we can't buy TC's for pest spells and preventatives (the spells that "prevent" pests will also remove them if the pests are of that level of card or below).
My gardening rank is level 3. Now I need to kill rank 4 pests. Bazaar does not allow me to buy rank 4 pest treasure card. Is there other way to kill pests?
I'm afraid not you'll need to level up. As long as you take care of the needs your plant is safe. It just means you cannot harvest it until elder. It's best to wait to plant seeds of a higher rank than your gardening level in future.