Some people think that when Rebecca is on the train her memory stops before Jack dies and while they are still happy and married. In my opinion this does not make sense because then she would not recognize her adult kids, her grandchildren, adult Beth, adult Sophie and Toby. Miguel tells her the phrase "you are my favorite person" the day before he goes to Houston, so after Jack's death. Also William has the age he had when he died which was 20 years after Jack's death. All these things make me think that Rebecca has her full memory while being on the train.