Is it OK to have an apostrophe at the end of a sentence?
Consider the following progression:
"I found my ticket, but not yours."
"I found my ticket, but not John's."
"I've enjoyed some Victorian novels, but not Dickens's." [pronunciation as indicated]
"I found our tickets, but not the Smiths'." [pronunciation as indicated]
"I saw our neighbours at the show, but not the Smiths'."
I think the perceived problem is with the ambiguity when reading out the plural possessive. Odd-sounding, and perhaps better rephrased, but I wouldn't say breaking any rule of grammar.
Syntactically there's nothing wrong with your sentence, the grammar checks out. If it still feels a little too funky for you, you could try:
I got the costumes for the guys, but not for the girls.