There's three possible explantions:
1. The "meta" explantaion. Obviously the writers had not yet written Generations
yet so they didn't "know" that Kirk was dead.
2. The "techno-babble" explanation. Geordi says that Scotty's pattern had only degraded by some fraction of a percent. It's possible
that that fraction of a percent was the "memory" of Kirk dying. It's unlikely and an extreme coincidence, but it's "possible" in the techo-babble sense.
3. The "colloquialism" explanation. Scotty could've been speaking in a figurative manner, saying that his chances of being recovered were so extreme and unlikely that it'd take Kirk coming back alive, reocvering the Enterprise and hunting him down for Scotty to be discovered and recovered.