I think this (good) exercise in the use of the calculus of fractions is made a bit more difficult than necessary because Gel'fand–Manin formulate the axioms in a self-dual way. Since we're dealing with (what I call) right fractions, it seems like a good idea to isolate the necessary parts of the axioms for this exercise. That this is possible is hinted at in remark 9 following the lemma you're trying to understand. Proofs sometimes become easier when one reduces the options one has and this is one instance, I believe.
To get to the maths, the axioms for right fractions read:
Let $\mathscr{C}$ be a category. A collection $\Sigma$ of morphisms in $\mathscr{C}$ is called a right multiplicative system (or right denominator set) if
- [RF 0] (non-triviality): the identity morphism of each object belongs to $\Sigma$: for all objects $C \in \mathscr{C}$ we have $1_C \in \Sigma$.
- [RF 1] (composition): if $s\colon A \to A'$ and $s'\colon A' \to A''$ are composable morphisms from $\Sigma$ then $s's\colon A \to A''$ belongs to $\Sigma$, too.
[RF 2] (Ore condition): Given an arbitrary morphism $f\colon A \to B$ and a morphism $t\colon B' \to B$ from $\Sigma$, there exists a commutative square

with $s\colon A' \to A$ from $\Sigma$.
Note: If $f$ happens to be from $\Sigma$ we do not assume that we can choose $f'$ to be from $\Sigma$, however, we can say that the composition $sf' = tf$ belongs to $\Sigma$ by [RF 1] because both $t$ and $f$ do.
- [RF 3] (cancellation condition): If $f,g\colon A \rightrightarrows B$ are two parallel morphisms such that there is $s\colon B \to B'$ from $\Sigma$ such that $sf = sg$, then there is $t\colon A' \to A$ from $\Sigma$ such that $ft = gt$.
I use the notation $(f/s)$ with $s \in \Sigma$ to represent a right fraction $A \xleftarrow{s} A' \xrightarrow{f} B$ (a “left $\Sigma$-roof” in Gel'fand–Manin's terminology): my rationale for the name-switching in the handedness is that $(f/s)$ represents “$f \circ s^{-1}$” in the localized category $\mathscr{C}[\Sigma^{-1}]$, so we compose $f$ with $s^{-1}$ on the right to get a morphism $A \to B$ in $\mathscr{C}[\Sigma^{-1}]$.
The above axioms are enough to prove that equivalence of (right) fractions is indeed an equivalence relation. The definition of equivalence of fractions as phrased in Gel'fand–Manin is somewhat confusing because it may suggest an incorrect interpretation (as witnessed in your question). Here's the diagram defining equivalence between $(f_1/s_1)$ and $(f_2/s_2)$ that is actually intended:

Note that the vertical morphisms $\bar r_1$ and $\bar r_2$ in this diagram are denoted by $r$ and $h$ by Gel'fand–Manin and neither of them is assumed to belong to $\Sigma$. What is assumed to be in $\sigma$ is the composition $\bar{s} = s_1\bar{r}_1 = s_2\bar{r}_2$.
If you read the proof of Lemma 8 a) of Gel'fand–Manin with this definition in mind, you'll see that they actually prove that the above relation is transitive (only using the parts of their axioms that I gave above), so I'll take that result for granted.
Before proceeding further, a trivial but useful
Remark. The equivalence diagram not only tells us that $(f_1/s\vphantom{f}_1)$ and $(f_2/s\vphantom{f}_2)$ are equivalent, but that they both are equivalent to their common expansion $(\bar f/\bar s)$: the upper half exhibits $(\bar{f}/\bar{s})$ to be equivalent to $(f_1/s\vphantom{f}_1)$ and the lower half gives that $(\bar{f}/\bar{s})$ is equivalent to $(f_2/s\vphantom{f}_2)$.
I think it is instructive to break your question into small and easy steps instead of proving the general well-definedness in one blow, so that's the route I'll take below. I'll give the details of most of the argument and think that it is safe to leave the rest only in outline. The direct route is of course possible, but, as you mentioned, it becomes somewhat messy.
One crucial observation to make towards proving the well-definedness of composition in the category of fractions is that the Ore condition [RF 2] reads $fs = tf'$, or “$t^{-1} \circ f = f' \circ s^{-1}$”, so it is not too surprising that we have the following:
Lemma. Given a wedge $A \xrightarrow{f} B \xleftarrow{t} B'$ in $\mathscr{C}$ with $t \in \Sigma$, any two right fractions $(f_1/s_1)$ and $(f_2/s_2)$ such that $tf_1 = fs_1$ and $tf_2 = fs_2$ are equivalent: “up to equivalence of fractions there's only one Ore square over any given wedge”.
(This observation is a variant of the heuristics at the beginning of remark 7 in Gel'fand–Manin)
Proof. We are given the two commutative squares

and we apply the Ore condition to the wedge $A_1 \xrightarrow{s_1} A \xleftarrow{s_2} A_2$ to get the commutative square

Observe that $s := s_1s_1' = s_2s_2' \in \Sigma$ because of the composition axiom. Moreover, we have $ t f_1 s_1' = f s_1 s_1' = f s_2 s_2' = t f_2 s_2' $ so that there is $s'\colon A'' \to A'$ such that $f_1 s_1' s' = f_2 s_2' s'$ by the cancellation axiom.
But this means that the diagram

is commutative, proving the equivalence of $(f_1/t_1)$ and $(f_2/t_2)$.
Finally, here's how the above leads to the desired conclusion:
In order to compose $(g/t)$ with $(f/s)$ apply the Ore condition to $f$ and $t$ to get the diagram

and apply the lemma to prove that the equivalence class of the composition $(g/t) \circ (f/s)$ is independent of the chosen Ore square over $f$ and $t$.
Replace $(f/s)$ by an expansion $(f_1/s_1) = (fr/sr)$ to see that the compositions $(g/t) \circ (f/s)$ and $(g/s) \circ (f_1/s_1)$ are equivalent, as shown by the following diagram

(this diagram proves all that you need for this case).
Similarly, replace $(g/t)$ by an expansion $(g_1/t_1)$ to see that the compositions $(g/t) \circ (f/s)$ and $(g_1/t_1) \circ (f/s)$ are equivalent (I leave this case as an exercise).
Combine 2. and 3. and use transitivity of equivalence of right fractions to see that the compositions $(g/t) \circ (f/t)$ and $(g_1/t_1) \circ (f_1/s_1)$ are equivalent: $(g/s) \circ (f/s) \sim (g/s) \circ (f_1/s_1) \sim (g_1/s_1) \circ (f_1/s_1)$, provided $(f_1,s_1)$ and $(g_1/t_1)$ are expansions of $(f/t)$ and $(g/t)$, respectively.
Use transitivity of equivalence of fractions to see that if $(f/s) \sim (f'/s')$ and $(g/t) \sim (g'/t')$ lead to $(g/t) \circ (f/s) \sim (g'/t') \circ (f'/s')$ by using 4. in order to compare $(f/s)$ and $(f'/s')$ to a common expansion $(f_1/s_1)$ as well as $(g/t)$ and $(g'/t')$ to a common expansion $(g_1/t_1)$.
To finish up, let me direct you to this thread for a discussion of related questions, some remarks on the significance of the “2-out-of-3” condition Agustí mentioned (it is called saturation in the other thread), as well as some useful links and references at the end the answer.