Most odometers work off the transmission tailpiece now days, This also drives the speedometer,, In the old days (say 1950-60-70-80 and even early 90's) it was cable drive, you did not have "Trip" meters then less you had two different dials
Today it's an electronic sensor that talks to the ECM (Engine control module/comnputer) that drives the display. It is.. In theory, NOT POSSIBLE for the speedometer to work and not the odometer.. But of course, that's only theory
Sometimes you may have a situation like I had a couple weeks ago.. The ECM did not fully initialize and I had to shut off the engine and restart.. That fixed it. .