OpenStreetMap doesn’t have any official router associated with it. (Note that the basic router on openstreetmap.org is just a tech demo.) Instead, developers are encouraged to come up with their own routers that take whatever features they feel important into account. For example, some routers based on OSM data pull in third-party publicly available elevation datasets.
The most commonly used routers for bicycle touring – Brouter and Cycle.travel – certainly take elevation into account and helped me personally out all over the world. Brouter has a hiking mode, though it is still in beta, and perhaps there are hiking-specific elevation-aware routers out there.