Ceftriaxone is preferred as it has better activity and achieves better intraluminal concentrations in the gastrointestinal tract.