PHILADELPHIA — A federal judge has dismissed a bid by a nationwide group of pharmacies to stop the merger of two of the country’s largest pharmaceutical benefits management companies.

The pharmacies sought an injunction days before the April merger of Medco Health Solutions Inc. and Express Scripts Holding Co., arguing that they would be harmed by a decline in the market for pharmaceutical benefit management services.