Winning first then losing gives a lower rating than the other way around, except in certain circumstances (the only exception I can think of is if after your win, your k-value lowers down). To see this, you need to understand roughly how Elo ratings work.
Suppose you play a person whose rating is D higher than you (with negative D if their rating is lower than yours). This is translated to a win probability (actually expected score, but whatever) P, which is the rough probability that you will win. For example, if D = 0, clearly P = 1/2. If D = 400, the formula gives P = 10/11, and if D = -400, the formula gives P = 1/11. The thing is that with larger D, you will also have larger P.
Then, the result of the game R is found; this is 0 (loss), 1/2 (draw), or 1 (win). Your rating is updated by K(R-P), where K is your k-value; this is normally constant for a given rating range (for example, 32 for players lower than 1600, 24 for players in 1600-2000, etc; this differs heavily between organizations keeping track of ratings). Thus your rating change is directly correlated to R-P.
Suppose your win probability in the first game is P1, and in the second game P2. Assume that your k-value remains constant.
If you win the first game, your rating gain is K(1-P1). If you then lose the second game, your rating "gain" is K(0-P2), totalling K(1 - (P1+P2)).
Similarly, if you lose the first game, your rating "gain" is K(0-P1). If you then win the second game, your rating gain is K(1-P2), totalling K(1 - (P1+P2)). Hey, they look equal.
The trick is that P2 in the first scenario is higher! After your gain of rating, your difference with your second opponent becomes more positive, and thus P2 is larger. Thus in the first scenario, as P2 is larger, your rating gain is lower.
Thus yes, if you will always win against one opponent and always lose against the other, but their ratings are equal, always choose to lose first before winning.
Note that this only applies if ratings are updated live; that is, after every game. If ratings are not updated live, your P2 will use the original rating and thus will be equal to P1 in both scenarios, giving equal result either way.
Let's say you were playing 2 games against 2 different players of equal rating.
If you first won a game than lost the other, would your rating be any different if you had lost a game first than won the other?
What if their ratings differed? Could you gain anything by losing to the lower rated player first, then winning to the higher rated player; as opposed to winning to the higher rated player, than losing to the lower rated player?