This is something that probably happens a lot. There's a number of ways that this could happen, and a number of responses. One could merely thank them and move on, apologize for bothering them, slink away without replying or send an angry email back. I suggested none of those options.
It seems to me that as long as communication is flowing between you and a hiring agent, you can still make a play. In this scenario, you can attempt to leverage the initial interview offer into, at least, a second viewing of your resume. You can also use this as a chance to expand on the reasons that you would have been a good fit for the job. You have be thoughtful, deliberate and focused in your reply (of course, you should be thoughtful, deliberate and focused in your job search, anyway), and you might need to tread a little carefully to maximize your chances of turning fortune in your favour. If you don't execute things properly, this will be your last shot at landing the job.
Of course, even if you execute this well, there still may be no hope. But if that's the case, why not take one final, desperate shot?
So, below is my response. It was a quick, off-the-cuff response, so it's not really deliberate or focused - it's more in the stream of consciousness style. If you have any thoughts or advice, please do share. Only once have I had to keep a job application of mine alive when it had appeared to be discarded, so I am by no means an expert.
Hi,(By the way, my friend is eminently qualified for this job, and I am certain she would be an excellent hire. The organization is probably making a mistake by not giving her an interview. Not that I'm biased or anything.)
First question, how much contact had you already had with this organization? Had you just submitted an application/resume then received a message saying you were shortlisted?
Second (well, third, I guess) question, was the person who told you that you were shortlisted the same as the person who sent you the terse note? Was this the same as the person to whom you initially applied (or did you apply to a generic email address or through an automated system)?
Here's why I'm asking, there can often be some mis-communication within an organization if multiple people are involved in the screening, hiring and interviewing processes. If the person who told you that you were shortlisted (Person A) is different than the one who said you weren't (Person B), you have a potential ally in your candidacy.
If this is the situation, you'll want to contact both parties at once. If Person A is clearly higher up in the management chain than Person B, I would send a polite email to Person A thanking them for extending an invitation for an interview, but, unfortunately, it appears that you were not shortlisted. I would try to make sure that there is a full email string on this. The original message, followed by your response, followed by Person B's response. I would also cc Person B on this.
If Person B is clearly in a higher position, or you can't tell who is, I would send an email to Person B, responding to the curt message, cc-ing Person A. I would thank them for their response. I would also state that I had been looking forward to the proposed interview, but understand that they are currently moving forward with other candidates. I would then say that I would still be interested in the position in the event that none of the other shortlisted candidates were found to be a fit. Finally, I would finish the email by thanking them for their time.
Okay, now if it was the same person who invited you for an interview and who sent you the terse note (we'll still call this person Person B), I would say something like:
"Hello Person B,
I am disappointed to hear that. After you had proposed an interview in your initial email, I was quite looking forward to the chance to discuss this position with you. It sounds like an exciting opportunity, and something for which I would be well suited. Nonetheless, I understand that you are moving forward with other candidates at this time. Should none of them be deemed a fit, please feel free to contact me if you would like to re-visit my candidacy.
Thank you for your time,
The Best Candidate You Never Hired (or just your name)
This is similar to the previous message, but there are a few differences. In this last scenario, though I would thank Person B for their time, I wouldn't thank them for their response. There's no chance of mis-communication here (though the terse message could be a mistake), so you can be a little more forceful. This is also why I would pointedly mention the interview that Person B proposed.
Assuming you've only been dealing with one person the whole time, if I were to guess, I'd say that, unfortunately, the first message proposing an interview was a mistake on Person B's part. It could just be that Person B thought they were responding to another candidate. Then, when they got your message, not realizing they invited you for an interview, they thought you were just being pushy, thus the less than polite message saying you weren't shortlisted.
Here's the thing, though. If this is the case, it's actually a good thing that the mistake happened. You still have an opening - a very small one, but one nonetheless. Some people might decide to interview you anyway, because they initially offered. Others might wonder why they didn't shortlist you in the first place and take another look at your application. Some might decide that by not just slinking off when rejected, you are now more attractive as a candidate. Someone demonstrating motivation is huge.
So, in this situation, you need to be graceful, professional and strong. You have to be polite, but you have to show determination and confidence. Too many "thank you's" could make you look too mushy. That's why I would only thank the person at the end of the email.
Also, since the odds are against you in this, you don't have a lot to lose. This is probably you're one shot to get back in the game, so write something that emotes, "I'm a damned good candidate, and you want to interview me. You don't want to pass me over." Strength and confidence - tempered by proper manners - is the best way to do this.
Returning to the original possible scenario (that you were dealing with multiple people and the error was an organizational error by the church), you needn't (and shouldn't) be quite as bold. In that case, you've got a better chance because at least one person is on your side. You can act a little (but only a little) more reconciled to the rejection, because you might have someone on the other side to fight your cause for you. That's why I would thank the person for the response at the beginning of the email and thank them for their time at the end. This approach is less all-or-nothing.
Does this help? Feel free to send me some more specifics of the situation and I can try to tailor my advice.