The idiom is certainly older than that film. Here's a possible origin from a website (somewhat 'cleaned up' by me!)...
"In World War I, something called a Stokes gun fired mortars resembling apples with a stick in them, so they were often referred to as Toffee Apples.
In the movie Rio Bravo in 1959, a guy tosses a hand grenade and says "How do ya like them apples?"
I'm guessing like most sayings from back then, it was something guys in the war said as a joke when they tossed grenades into the enemy trenches, as if to imply the enemy would be stupid enough to think grenades are apples."
It meant some small victory or put-down against an opponent in the USA and is similar to the British phrase, "Put that in your pipe and smoke it!"