Mucus is caused by a bacterial infection in the biliary duscts and the waste products of the bacteria are thick viscous phlegm. Can be white/yellow/green in colour.
Sludge is a super-saturation of bile and a fairly natural process. It can clear it self and reappear and mostly doesn't cause any problem but it can build up and form gallstones. Has the consistency of jelly and is green like melted cholesterol stones.