India's definition of what is and what is not a language is highly politicized and highly idiosyncratic. Hindi and Urdu, by any reasonable linguistic definition are not separate languages. The official standards for both Hindi and Urdu, are both based on the form of the huge dialect continuum that spans North India and Pakistan, as spoken in Delhi. The only difference is that Urdu uses Persian and Arabic as inspirati…
Personal anecdote: when I first went to South Asia, I spent time in southern Pakistan and learned some basic Urdu. Then I spent time in north India, among Hindi speakers. The language I'd learned was immediately usable there, but my local friends could also tell where it came from -- and sometimes would tell me "Aha! yes, we know what you mean, but that's an Urdu word - in Hindi we say ...."
So even on a basic street level, I don't think it's true that they're identical. Both part of the same huge dialect continuum, yes, but they're slightly different points on it.
Whether to call them separate languages is as much a political question as a linguistic one, of course.