Sorry to hear about that situation. Its unfortunate how often that landlords do this to their renters. You can buy it from the bank but the ways to do it are limited. If it goes into traditional foreclosure sale, they will sell it on the county steps more than likely. Check with the local county clerk for that information on when the next sale might be.
Another route that is less successful, is getting in touch with the bank foreclosing on it and explain the situation and see if you can maybe work a deal out with them as far as buying it out. I wouldn't get my hopes up on this route because it rarely works. If you do choose to go this route, I would try to get in touch with a manager or somebody in a higher position.
Lastly, legal counsel is always worth having. If you cannot manage to get the property, you will need to figure out your options. A local real estate attorney would be worth contacting and discussing your options. I would recommend sooner than later, too, so that you aren't scrambling to find out what you can do.Your area may have different laws but in Texas, there are laws protecting renters from foreclosure and giving them a few legal options over being kicked out once it transfers possession.
Hope that this helps a bit!
Good luck in your situation.