India and Pakistan have stepped back from the brink of all-out war, with a nudge from the U.S., but New Delhi’s aspirations as a global diplomatic power now face a key test after President Donald Trump offered to mediate on the dispute over Kashmir, analysts said.