The meaning is correct in all of the sentences, though the first one could be edited to make it clearer that "young" refers to the girls. For example: "In the olden days, girls married when they were young." or "In the olden days, young girls could get married."