score:1
Unless you are staying for more than 30 days, you do not need to a visa to enter mainland China.
You will need to show your Ecuadorian passport at check-in. When landing in HK you can show them either passport. When exiting Hong Kong, you show them the Ecuadorian one again. So the only time you will actually need the US passport is to re-enter the US, so you will have to show it when flying out of Hong Kong.
Upvote:2
Yes, your sequence looks ok. Note that there is no US immigration control on your way out of US, so your second step will be missing.
Also you might need to show both passports at HK exit and Mainland China exit - HK side might want to ensure you'd get into China, and vice versa.
Note, however, that China issues US citizens a 10 year visitor visa (same cost as 1yr visa); not sure if it is the same for Ecuadorean citizens. Thus if you plan to visit China again in near future, you might consider the cost calculation.
Regarding crossing, it is similar to airport - you do NOT cross the border in a train, and the immigration formalities are not conducted in a train. You leave a train, walk through HK immigration, walk to Mainland China (I believe you walk over a bridge on this crossing), come to Mainland, fill up your forms, go through immigration, and jump into subway.