Pakistani security forces, acting on intelligence, raided multiple militant hideouts in the country’s northwest near the Afghan border and killed 38 militants, the military said Tuesday.