Miles don't get added on a per segment basis, they get added when you complete an outbound or inbound or stopover depending on how the fare is composed.
You can op-up in transit - go to the transfer desk or at lounge reception: you will be eligible for F lounge access if you upgrade at the airport for miles.