Trilithium is a 24th century development, trilithium resin is a byproduct of their ships. Memory alpha wiki kind of makes it seem like its just a 24th century byproduct (it doesn't say that, but they only mention 24th century ships), but doing a quick scan through the TNG script "Starship Mine" where "trilithium resin" was first introduced in (and the DS9 "For the Uniform" script where it's mentioned again) it's just stated to be a highly toxic and highly volatile waste product produced by their engines.
There's nothing about it being a new development, or a byproduct specific to new tech on the Enterprise-D, so I don't think its unreasonable to believe that it's always been a waste product produced by star fleet engines. Actually, I think that's what was originally implied by "Starship Mine."
Not quite— In a confusing stroke of terminology, the substance being developed by the Romulans is called "trilithium," but it is not the same substance as "trilithium resin" (maybe it was developed from studying the warp byproduct?) as Worf says it's an experimental compound the Romulans have been working on, and Riker hadn't heard of it before— so I doubt it was supposed to be the same substance mentioned in TNG and DS9 before it.
Interesting. In any case, I am embarrassed that I recalled that bit of trivia. I need to make better use of my memory.
No wonder I forget where I set my keys down, all the time.