Pronunciation of Detritus
I had thought that detritus would be pronounced like detriment, but apparently not.
Why not?
Is there something in the etymology?
Are there any other words of English origin written "-trit-" pronounced "trai"?
The identity of a preceding consonant is rarely relevant to the pronunciation of a vowel letter in English, so I don't think it's very helpful to look for other words spelled with -trit-. That said, Carly and Mynamite's comments have pointed out other examples, such as Triton and contrite; I'll add gastritis, nitrite, attrited.
Many pronunciations are possible in principle for words with this spelling pattern
If you're trying to examine patterns to the pronunciation and spelling of English words, it's more fruitful to look at the letters after a vowel: in particular, the number of consonant letters directly after it, and the number of syllables until the end of the word.
In general, when a word ends in the spelling pattern VCVC (where V represents a single "vowel letter", i.e. one of {a e i o u y}, and C represents a single "consonant letter") the first V might be pronounced with a "long vowel" sound if it is in a stressed syllable.
So, when the vowel in the second-to-last syllable is I (as in detritus), it might be pronounced as a "long i" sound /aɪ/. Other examples of a "long i" sound in this context: horizon, arthritis, divisor, revival, suicidal, climax, item, titan, chitin, crisis.
I said "might" because it's also possible for a vowel to be "short" and stressed in this context, as in exhibit, explicit, linen, mimic.
And in words of more than two syllables ending in the spelling pattern VCVC, it's very common for the second-to-last syllable to be unstressed (as in origin, officer, criminal, and your own example of detriment).
Why words with the same spelling pattern have different pronunciations
You brought up etymology. This is a common influence on a word's pronunciation.
It's likely that the pronunciation of detritus with stress on the second-to-last syllable is derived from the pronunciation of the Latin word detritus (which had a long vowel in the first and second syllable: dētrītus), which is stressed on the second-to-last syllable.
English words that have the exact same form as their Latin source are often stressed in the same position (but not always: some words such as abdomen and acumen—once commonly pronounced with stress on the second-to-last syllable, as in Latin—are now widely pronounced with stress on the third-to-last syllable).
But English words that end differently from their Latin source are often stressed in a different position. The word detriment ultimately comes from the Latin word detrimentum, pronounced dētrīˈmentum (with stress on the second-to-last syllable). But in English, detriment is stressed on the first syllable rather than on the last.