I realize you hear this all the time. Don't write what's popular because by the time you have it ready the trend will have moved on.
So writers see that and think that there are exceptions and their book will be one of them and so they are going to write this trendy YA Zombie Dystopian Steampunk* and just let anyone try to stop them.
And they aren't completely wrong. There are always exceptions. That's why I'm always saying that no genre is ever dead, just maybe hibernating. But you still shouldn't write to trends.
First, the books you see coming out now in "dead" genres are not new acquisitions. Chances are, these books were sold quite a while ago. Don't believe me. I just sold a book last month with a projected release date of mid-2016. This was what worked for the author and publisher, in their schedules. It happens all the time.
Second, editors are readers just like everyone else and they can get burned out quickly. At the beginning of the summer, if you had asked me what the hot genre was, I would have said YA contemporary. It felt like that was all anyone was buying (not true at all, just my perspective). I just got an email from editor saying that while she still loves these stories, her list is full of them now and so she needs to diversify. And she's not the only one.
These trends have a flash-bang shelf life. They come out blazing, everyone gobbles up the really great ones and then it fizzles out. The next big thing comes along, rinse and repeat. If I had a magic ball, I would absolutely tell you what the next big thing is. I promise. However, I don't know and honestly, I don't think it would do you any good. By the time I told you, you'd need to be able to draft, rewrite and edit a brand new manuscript in under a month in order to cash in on the newest trend.
So does that mean a lot of publishing comes down to timing and being in the right place at the right time? Yes and no. Write what makes you happy, even if that book can't sell right now. This is where an honest agent/partner can help. I have a client with a dystopian, a really unique dystopian. But we aren't doing anything with it right now. Not because I don't want to sell her book, but because I know that right now trying to sell it would be an act of futility.
Write, write a lot, write different kinds of books, write stories that make you happy, write the stories that need to get out. And accept the fact that you may or may not sell that book. You may need to let that book sit for a year, or five. But if you've been writing then you'll have something else to sell in the meantime and it won't matter. Don't write to trends.
* If you have a YA Zombie Dystopian Steampunk, please let me read it. :)