I think the D in Detective Jones should always be capitalized, because I believe that is the norm.
But what if, after introducing Detective Jones, I later refer to him as The Detective. For example:
Detective Jones asked me a few question, which I answered. After listening carefully and taking notes, the Detective then came back to me with some more questions.
I think you would capitalize the D, because "the Detective" is being used as a shorthand for "Detective Jones". But it looks a little odd, so I am not sure.