India was in touch with Togo authorities to secure on compassionate ground the release of the sailor whose family wanted him to conduct the last rites of his 11-month-old son.
Indian officials from Accra had met the sailor recently and had been pursuing the case of his release with the authorities there.
James has been released, the sources said, adding he is expected to return home by tomorrow.
He was under arrest in the west African country since July on the charge of aiding pirates who had attacked and looted his Marshall Islands-flagged MT Ocean Centurion on July 16.
It was reported that the infant, Vivaan, underwent an operation for intestinal gangrene but doctors could not save him as the infection had spread to his bloodstream.