What you are proposing is not profit maximising. Consider a deviation from you proposal where the firm takes out one less unit of the market loan. Then the marginal loss in output is $r_i$ while the marginal saving in costs is $r_m > r_i$. As such, the firm can strictly increase its profits by reducing the amount of market loans.
The problem for the firm is the following:
$$
\max F(k_m + k_b) - r_b k_b - r_m k_m \\\text{ subject to } k_b \le k_0, k_b \ge 0, k_m \ge 0
$$
where $k_m$ is the amount of market loans and $k_b$ is the amount of subsidized loans (which is capped at $k_0$).
The Langrangian is
$$
L = F(k_m + k_b) - r_b k_b - r_m k_m - \lambda(k_0 - k_b) + \mu_b k_b + \mu_m k_m
$$
The Kuhn-Tucker first order conditions read
\begin{align*}
&F'(k_m + k_b) +\lambda + \mu_b = r_b,\\
&F'(k_m + k_b) + \mu_m = r_m\\
&\lambda(k_0 - k_b) = 0,\\
&\mu_b k_b = 0,\\
&\mu_m k_m = 0
\end{align*}
$$
If $\lambda = \mu_b > 0$ then $k_b = 0$ and $k_b = k_0$, which is impossible.
There are several cases to consider:
$\lambda = 0, \lambda_b > 0, \mu_m > 0$.
In this case we have that $k_b = 0$ and $k_m = 0$. This can only be if
$$
F'(0) + \mu_b = r_b \text{ and } F'(0) + \mu_m = r_m,
$$
So $F'(0) < r_b < r_m$. In this case, it is simply too costly to borrow anything.
$\lambda = 0$, $\mu_b > 0$ and $\mu_m = 0$. In this case, $k_b = 0$. Then
$$
F'(k_m) + \mu_b = r_b \text{ and } F'(k_m) = r_m
$$
But then $r_m = F'(k_m) < r_b$, which is impossible. So this case is ruled out.
$\lambda >0$, $\mu_b = 0$, $\mu_m > 0$. Here $k_m$ is equal to zero, $k_b = k_0$ and $k_m = 0$. Then
$$
F'(k_0) + \lambda = r_b \text{ and } F'(k_0) + \mu_m = r_m.
$$
In this case, the firm will take up the entire subsidized loan. However, taking up additional amount of market loan would be too costly as $r_m > F'(k_0)$. Here increasing $k_0$ will increase profits as $\lambda > 0$ and increasing $k_0$ will also increase total output $F(k_0)$.
$\lambda > 0$, $\mu_b = 0$, $\mu_m = 0$. In this case we have that $k_b = k_0$ and
$$
F'(k_0 + k_m) + \lambda = r_b \text{ and } F'(k_0 + k_m) = r_m.
$$
This is the case in the figure. The firm will take up the entire amount $k_0$ and some additional loans $k_m$. Now, notice that if $k_0$ increases (and we remain in case 4) we still have that $F'(k_0 + k_m) = r_m$. So the total amount of capital $k_0 + k_m$ should remain constant. This means that the increase in $k_0$ is entirely compensated with an equal decrease in $k_m$. The profits will increase $(\lambda > 0)$ but the total amount of capital and the total output $F(k_0 + k_m)$ will not change.
$\lambda = 0, \mu_b = 0, \mu_m = 0$. In this case,
$$
F'(k_b + k_m) = r_b \text{ and } F'(k_b + k_m) = r_m,
$$
which is impossible as $r_b < r_m$.
$\lambda = 0, \mu_b = 0$ and $\mu_m > 0$. In this case, $k_m = 0$, so
$$
F'(k_b) = r_b \text{ and } F'(k_b) + \mu_m = r_m,
$$
In this setting the firm will only take up subsidized loans up to the point where $F'(k_b) = r_b$. Increasing $k_0$ will have no effect as the constraint $k_b \le k_0$ is not binding at the optimum.