Unless you have the authority to guide the project back on track, there are only so many options available to you:
1: Document your concerns and any problems you've identified. Be objective wherever possible (i.e don't bitch about your co-workers even if the reason the project is failing is because they're fucking it up). Any problems that you've spotted and are worried about, WRITE THEM DOWN and email them to your project manager.
2: Keep a cool head. This is incredibly difficult once endless frustration sets in. Bite your tongue, and don't get personal. You will probably fail from time to time, because knowing that you're going to fail is a horrible, insomnia-inducing feeling, and your patience will almost certainly be tested.
3: Offer solutions. If you think a particular decision is to blame for some aspect of the failure, then document it, what went wrong, and what any alternatives may be.
Unfortunately, in my experience and from what I gather from other people, these kind of things tend to come along with ridiculous company politics and emotions. If your gut feeling is that it's going to fail, then your best approach is to try to raise the alarm as soon as you notice. You may be ignored or brushed aside, but you must document everything you do. Don't raise the concerns in conversation, make sure there is a paper trail.
In my own case, the project failures ultimately led to me and several other developers abandoning the company. The project could have been saved if our concerns were taken into consideration and acted on. We even presented a proof of concept redesign which solved all of the existing problems AND presented new opportunities for growth, and were told that our new design would not see the light of day. Keep in mind that we had working code, schemas, deployment plans, addressed scalability concerns, and even had a development roadmap for the new design. Some battles are un-winnable.