I think this logic gets you there:
If a solution works for a case where all values are maxed out, it will work for any lower value cases. Since each box has a different weight from 1 to 10, and the total sum can not exceed 40, we know 10+9+8+7+6+5= 45 is out. However, 10+8+7+6+5+4=40 is allowed. Since they are labeled in ascending order of weight, this gives A=4, B=5, etc. Since each porter is able to carry 20 lbs, we want to use the largest possible values to make 20 from this set, which is 10+6+4 or A+C+F. Since these are the largest integers from the set of largest allowed values, this is the upper limit and this solution will always work for the constraints given. If one porter carries A+C+F, the other must necessarily carry B+D+E for all the cases to make it up in one go.
Edit: As @BMS21 points out, this doesn't quite work when the weight is more distributed to the middle or bottom as in @Oray's examples.