This phase III trial studies how well the addition of radiotherapy to the usual treatment (chemotherapy) works compared to the usual treatment alone in treating patients with esophageal and gastric cancer that has spread to a limited number of other places in the body (oligometastatic disease). Radiotherapy uses high energy x-rays, gamma rays, or protons to kill tumor cells and shrink tumors. Drugs used in usual chemotherapy, such as leucovorin, 5-fluorouracil, oxaliplatin, and capecitabine, work in different ways to stop the growth of tumor cells, either by killing the cells, by stopping them from dividing, or by stopping them from spreading. Adding radiotherapy to the usual chemotherapy may work better compared to the usual chemotherapy alone in treating patients with esophageal and gastric cancer.