This phase II trial studies how well pralatrexate and oxaliplatin work in treating patients with esophageal, stomach, or gastroesophageal junction cancer that cannot be removed by surgery or has spread from the primary site (place where it started) to other places in the body. Pralatrexate may stop the growth of tumor cells by blocking some of the enzymes needed for cell growth. Drugs used in chemotherapy, such as oxaliplatin, 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. Giving pralatrexate with oxaliplatin may be an effective treatment for esophageal, stomach, or gastroesophageal junction cancer.