I was in a similar situation, where the job was advertised and all internal candidates were encouraged to apply, but told there would be an external search anyway. As it turned out, there was an internal candidate who was favored to get the job, and in the first six months he made sure to get rid of all the other internal candidates who wanted his post. Your company politics may vary, but things aren't always obvious.
In an earlier job, I went through something similar too, so I chose not to apply. I'm sure if I applied, I'd have been out quickly too. The person selected did nothing but play politics, taking credit for everything good and passing down blame for anything bad. I ended up leaving after a year anyway.