A court has temporarily halted generic drugmaker Sun Pharmaceutical Industries Ltd's $3.2 billion takeover of rival Ranbaxy Laboratories Ltd until it decides on a petition for a probe into alleged insider trading.