I think you can go 2 ways with this hand. Either raise the flop ( as mentioned above) to protect from draws and get max value out of 9x hands, or take the line you took and fold river. think the lead on the flop is most likely a hand like 9x. could also be 2 weak spades, maybe a straight draw ( Not saying that would be the best way to play those, but you see that from time to time). but don’t think you ever see a set or 2 pair lead there. If you get called you can assume that you are beat on the river, only beating hands like 10 8 or something random.
I do think however the optimal play is to raise flop, or at least bet small on the turn. be a little more agro with big overpairs.