You have assumed a reversible and isothermal process but a significant piece in the governing equation you used hides what really happens. The culprit here is that you assumed an "ideal" gas. As you will see, isothermal entropy transport is not the source of work, it does something else.
Recall the Gibbs-Duhem equation for a fluid in a closed system but note that you cannot get that from $dU=TdS-pdV$ because if you do so then the result is $SdT-Vdp=0$ which, in general, is obviously nonsense. Specifically, it implies that an isothermal process, $dT=0$, must also be an isobaric process. The error is that we have ignored the chemical potential and its contribution.
In fact, for any fluid, in general, for any simple single phase system the Gibbs energy conservation equation is $dU=TdS-pdV+\mu dN$, and combined with $U=TS-pV+\mu N$ follows the corresponding Gibbs-Duhem equation:
$$SdT-Vdp+Nd\mu =0 \tag{1}.$$
Calculated properly, even in a closed system for which $N=\text{const; }dN=0,$ the chemical work terms stays! Since this holds for any two equilibrium states that are infinitesimally close to each other, it also must hold, per force, in an integrated form to finite differences between two arbitrary equilibrium states, say, $\mathcal P_1$ and $\mathcal P_2$ that are connected by a reversible path along which every state is an equilibrium one:
$$\int_{\mathcal P_1}^{\mathcal P_2}SdT-\int_{\mathcal P_1}^{\mathcal P_2}Vdp+\int_{\mathcal P_1}^{\mathcal P_2}Nd\mu =0 \tag{2}$$
Every term in Eq (2) represents work, and that their total sum is zero means that in a reversible process the energetic interactions balance each other.
Now assume that the reversible path is also an isothermal one, $dT=0$, and taking into account that your system is assumed to be closed, $N=\text{const}$, then you have
$$\int_{\mathcal P_1}^{\mathcal P_2}SdT-\int_{\mathcal P_1}^{\mathcal P_2}Vdp+\int_{\mathcal P_1}^{\mathcal P_2}Nd\mu \\=
-\int_{\mathcal P_1}^{\mathcal P_2}Vdp+N\int_{\mathcal P_1}^{\mathcal P_2}d\mu \tag{3}=0$$ or in the case of a closed system, $N=\text{const}$,
$$\int_{\mathcal P_1}^{\mathcal P_2}Vdp = N(\mu_2-\mu_1) \tag{4}$$
Integrate the differential identity $-pdV=pdV-d(pV)$ along the process $$-\int_{\mathcal P_1}^{\mathcal P_2}dV=\int_{\mathcal P_1}^{\mathcal P_2}Vdp+\int_{\mathcal P_1}^{\mathcal P_2}d(pV)$$ and you get
$$-\int_{\mathcal P_1}^{\mathcal P_2}pdV=\int_{\mathcal P_1}^{\mathcal P_2}Vdp+(p_1V_1-p_2V_2) \tag{5}$$
Eq.(5) shows the work done on the environment. In the special case of an ideal gas described by $pV=NRT$ and going through an isothermal process, $dT=0$, $pV=\text{const}$ and $p_1V_1-p_2V_2=0$, so
$$ -\int_{\mathcal P_1}^{\mathcal P_2}pdV=\int_{\mathcal P_1}^{\mathcal P_2}Vdp \tag{6}.$$
What this tells you is that during its isothermal expansion/compression of the gas the chemical work, $N(\mu_1-\mu_2)$, is converted into mechanical work by changing the chemical energy of the fluid while changing its volume and pressure from $V_1, p_1$ to $V_2, p_2$.
Integrating (1) for an ideal gas, $pV=NRT$ while $dT=0$ gets you its chemical potential as $\mu(p,T)=\mu_0(T)+RT\ln|\tfrac{p}{p_0}|$ showing its logarithmic dependence on pressure at constant temperature. Because of the assumption that the process is isothermal, $dT=0$, the entropy transport between the reservoir and the system does not directly participate in the work delivery, instead its role is to keep the temperature constant, here, specifically, for the chemical potential, as the system works on its environment.
To arrive here we did not need to know that the internal energy of an ideal gas depends only on its temperature (Joule's law). This is important because the caloric equation of state, $U=f_u(T,V)$ is independent of its thermal equation of state $T=f_T(p,V)$, one does not follow from the other. And if $U\ne f_u(T)$ but also depends on $V$, say, then one cannot conclude that in an isothermal process the delivered work $w$ equals $q$.
An additional comment is in order. The differential form of the Gibbs-Duhem equation (1) is true to any portion of the fluid body, so it could be interpreted as
$$\Delta SdT-\Delta Vdp+\Delta Nd\mu =0 \tag{1a}.$$ where $\Delta S\div S =\Delta V\div V=\Delta N \div N,$ and you could conceive (1a) as referring to a certain piece of the thermodynamic body going through a reversible process. When interpreted that way it could also mean that a certain piece of the size of $\Delta S, \Delta V, \Delta N$ having intensive parameters $T, p, \mu$ are being added and then the same amount is removed with $T+dT, p+dp, \mu+d\mu$ from the system. Then the Gibbs-Duhem equation gains an important new interpretation that is really illuminating: the equation (1a) or its integrated form
$$\int_{\mathcal P_1}^{\mathcal P_2}\Delta S dT-\int_{\mathcal P_1}^{\mathcal P_2}\Delta Vdp+\int_{\mathcal P_1}^{\mathcal P_2}\Delta Nd\mu =0 \tag{2a}$$
expresses a universal work conservation among elementary work processes in which the system is sandwiched between two sets of sources and sinks, one source/sink pair for each of the extensive quantities. In a reversible process, work converts only to work and only work converts to work.
As regards your second question, since it is assumed that the process is reversible the total entropy does not change at any step, whatever entropy is absorbed from the constant temperature reservoir and is lost by it will increase the entropy of the system by exactly the same amount. If the process were irreversible then the system entropy would increase its entropy more than the amount it absorbed from the reservoir.