The occupiers required Jews and Romani to be confined in overcrowded ghettos before being transported by freight train to extermination camps where, if they survived the journey, most were systematically killed in gas chambers .