Step 1: Understanding the Concept:
The question requires matching prominent foreign travelers to medieval India with key events or characteristics associated with their lives and writings.
Step 2: Detailed Explanation and Matching:
(A) He arrived in Ghazni as a hostage...: When his homeland of Khwarizm was conquered by Mahmud of Ghazni in 1017, (I) Al-Biruni was taken to Ghazni as a hostage. It was from there that he developed his interest in India and accompanied Mahmud's raids.
(B) He reached Sind in 1333 and was later appointed as the qazi of Delhi: The Moroccan traveler (III) Ibn Battuta reached Sind in 1333. He traveled to Delhi where the Sultan, Muhammad bin Tughlaq, was impressed by his scholarship and appointed him the \textit{qazi} (judge) of Delhi.
(C) Physician to Prince Dara Shukoh: The French traveler (II) François Bernier came to India in the mid-17th century and worked for several years as a physician to Dara Shukoh, the eldest son of the Mughal emperor Shah Jahan.
(D) Wrote a detailed account of trade and society in South India: The Portuguese writer and official (IV) Duarte Barbosa traveled to India in the early 16th century. He wrote a detailed account of the trade, social customs, and political systems of South India, including a valuable description of the Vijayanagara Empire.
Step 3: Final Answer:
The correct pairings are: A-I, B-III, C-II, and D-IV. This corresponds to option (2).