Ok, so basically from here we have to say that we can't answer the original post without the further information of why each of the individuals wishes to please God/others - it is possible for both to want to please God/others in a way that uses others as means to an end and not ends in themselves.
The "act" is not what matters here, as you have displayed that the act can represent behaviour which is self serving or uses a good deed for other ends. I don't see how that could be considered ethically equal to someone that performs the same act for no other reason than to please another person - the full motive for the act needs to be known to make a judgement. There is a difference between buying a child an ice cream simply to please the child and buying a child an ice cream to shut them up, to make someone else happy, or for some other reason, if we are looking at this from the perspective of "superior ethics" which the original post outlined.
Therefore fact that the means of pleasing the deity is good doesn't really tell us about the ethics of that person - we can only know about their ethics if we know their motivation for pleasing the deity, so I would disagree that the "ETA" section provides us with an answer to the original problem.
I would argue that it is possible for Person B to be treating human beings as an end rather than a means, but that it is impossible for Person A to be treating human beings as an end, and therefore Person B has the potential to be acting more ethically than Person A, but doesn't necessarily do so.
I suspect there will be disagreement from some on that, notably those that beleive in the God that is being pleased - from an agnostic perspective, the human is the highest end, for the believer the highest end is God - the most ethical person is therefore the person that performs an act purely for the highest end. If we disagree what that end is, we will disagree in our answer to the original question (if we assume that both Person A and Person B are acting as though God/others are the highest end and that neither are acting in such a way for other ends, and I think we have to make that assumption otherwise we will get bogged down in the infinity of possibilities that represent those other potential ends).