This phase II trial studies how well atezolizumab with or without cobimetinib works in treating patients with bile duct cancer that has spread to other places in the body and cannot be removed by surgery. Monoclonal antibodies, such as atezolizumab, may interfere with the ability of tumor cells to grow and spread. Cobimetinib may stop the growth of tumor cells by blocking some of the enzymes needed for cell growth. Giving atezolizumab with cobimetinib may work better at treating bile duct cancer.