The standard assumption is that magic is rare (the PCs being exceptional). Even if the quarry does have Invisibility or PWT they can be tracked with Survival skill (smell*, footprints etc). Investigation skill can be used to ask questions, look for clues, interrogate contacts etc, that can lead to hideouts. Or you can use your contacts (acquired through an appropriate background) to hire someone with specialised abilities - you know, just like actual detectives in detective stories do. In The Sign of Four Sherlock Holmes (who cannot cast spells) borrows the dog Toby to track a suspect. Part of being a detective is having contacts with skills you might need.
You have to be a level 13 ranger to cast Divination anyway - that's much higher level than most games - if you need it a 9th level cleric is more likely to be available. And the Ranger's spell list is stuffed full of spells relating to plants and animals - you thinking of a subclass with a unique spell list!?
If the setting is high magic, you know what class all the detectives are? Divination wizard.
No, frankly, its bullocks. At it's core Ranger Class = wilderness guy.
* The most useful tracker is actually a druid wildshaped into a bloodhound.