Oh dear. Well, I agree with Pete L. Clark's take on the situation, but I feel it's important not to mince words and to be extra clear about what's going on: frankly, the only conclusion I can draw from your story is that the people you are dealing with are some combination of: unscrupulous, dishonest, acting in bad faith and/or incompetent.
Let me explain. The university that invited you to interview knew full well that you are tenured and are expecting a tenured position, given your situation as someone who has been tenured for over 3 years and is now on your second(!) tenured position, in an institution comparable to theirs in reputation. It seems inconceivable to me that they would think an untenured position would be remotely attractive for you. Thus, if they invited you to interview for a position advertised using the words "the University of X invites applications for a tenure-track Assistant Professor or Tenured Associate Professor", to my mind that means they are representing that:
they consider you (at least based on how you look "on paper") a qualified candidate for serious consideration for a tenured position, and
they know, and know that you know, and know that you know that they know (etc), that you would be traveling to the US for the interview on the expectation of being considered for a tenured position.
If you accept that this is so, how is this consistent with their subsequent behavior, that is, the communication you received from their dean? As I said, there must be some bad faith, dishonesty or incompetence involved. Possible explanations I can think of are:
The department invited you for an interview but never intended to seriously consider you for a position. For some shady reason, they want to go through the motions of appearing to try to hire you (or appearing to try to hire someone) but not really wanting to finish the job. They are expecting you to say no to their untenured offer.
The department wants to offer you a tenured position, but the dean is against it, maybe because of some internal conflict with the department. So the dean is disingenuously trying to propose to offer you an untenured position, assuming that you'll say no (or perhaps hoping he'll get lucky and you'll say yes).
At the time the department invited you to interview, both they and the dean thought they would be able to offer a tenured position, but because of some change in circumstances (budget cuts or whatnot) they are now unable to do so. Instead of admitting that you made the trip in vain, which would be embarrassing, they are pretending they were thinking of an untenured position all along.
I should add that at my university, if we were thinking of offering an untenured position to someone who is already a tenured professor, we would make that very very clear to them before they come to interview to avoid a major waste of time and effort for them. It is clear to me (based on my experience having been a department chair for 3 years) that any university with competent people acting in good faith would behave similarly.
To summarize: this whole situation smells like bad news. You can consider accepting the untenured offer if you think that it's something you can live with and are willing to overlook being treated in this shady way, but personally I think that a rational response would be to politely explain to the dean that you are expecting an offer at a level comparable to your current position, and that if he/she is unable to make such an offer, you wish him/her luck in recruiting someone else - just on the off-chance that there's been some innocent mistake and they will be able to offer you a tenured position after all.
I wouldn't bother complaining or expressing outrage in your response to the dean about the rudeness of making you travel to the US under a dishonest pretext; these (most probably) unethical people are not worth trying to reason with - if they can't respond to your entirely reasonable request, just cut your losses and move on. Good luck!
Edit: when you email the dean with your polite reply, it might be a good idea to copy the department chair, again just on the off chance that there's been an innocent mistake and that having people other than the dean aware of what's going on will help correct the situation more quickly. I don't think that scenario is very likely, but it's best not to make assumptions.