Hello Monica, the rules you have are not wrong it is just your choice of tense for one of the actions. You are trying to use a continuous form when a simple form is better.
As you say 'When I walked into the room, everyone was working..' is correct and natural.
The same is true with the second sentence
'When her train arrived we were waiting at the station.'
You could turn them around and say
'While we were waiting at the station, her train arrived.'
But take care when doing this!
You can use two continuous actions together ' While I was cooking dinner, John was doing his homework.
Hope this helps