You are correct that an uniformly increasing cost of production cannot exist alongside economies of scale. A constant returns to scale production function is homogeneous of degree one:
$$ f(\lambda x, \lambda y) = \lambda \cdot f(x, y)$$
That is, when you double all the inputs you also double the output. An increasing returns to scale production function is one for $\lambda > 1$ (so that you actually increase the resources) in which $f(\lambda x, \lambda y) > \lambda \cdot f(x, y)$ (e.g. double the inputs and more than double the outputs for at least some combinations of inputs). However, it is problematic for a production function to have increasing returns to scale for all levels of inputs. Increasing returns to scale means fewer and fewer inputs are needed for each marginal unit of output. This generally means that marginal cost of production is also falling. This has all sorts of bizarre consequences, including the potential for indeterminacy (multiple equilibrium levels of output), downward sloping supply curves, and equilibrium non-existence. We also don't generally think it is true in reality. It is widely observed that beyond a certain scale most industries do not exhibit further returns to scale. For some industries, like dry cleaning, this scale is quickly reached, for others, like automobile manufacturing or social networks it may be very large indeed. But we generally believe that eventually the marginal cost of production will rise with scale. Even if we bought exactly the same car in same color, we'd still eventually want so many that the cost of labor, rubber, and metal would rise from that demand, driving up the marginal cost. We also face dis-economies of scale like managerial incentive problems and other difficulties of managing and controlling an increasingly large institution.
It is worth noting that you can have increasing returns to scale but decreasing marginal product of inputs. For example, the production function:
$$y(\ell, k) = \ell ^ {.75} \cdot k ^ {0.6}$$
has increasing returns to scale:
$$y(\lambda \ell, \lambda k) = \lambda^{1.35} \ell ^ {.75} \cdot k ^ {0.6} > \lambda \cdot \ell ^ {.75} \cdot k ^ {0.6} $$
But holding fixed the other input, we can see that the marginal product of both $\ell$ and $k$ are decreasing in that input. E.g.:
$$ \frac{\partial y}{\partial \ell} = 0.75 \ell ^ {-0.25} \cdot k ^ {0.6}$$
$$ = 0.75 \frac{k ^ {0.6}} {\ell ^ {0.25}} $$
Similarly:
$$ \frac{\partial y}{\partial k} = 0.6 \ell ^ {0.75} \cdot k ^ {-0.4}$$
$$ = 0.6 \frac{\ell ^ {0.75}} {k ^ {0.4}} $$
We could also continue this and show that the second derivatives here were both negative, which means decreasing marginal product from each input
$$ \frac{\partial^2 y}{\partial \ell^2} = -0.75\cdot 0.25 \frac{k ^ {0.6}}{ \ell ^ {1.25}}$$
$$ \frac{\partial^2 y}{\partial k^2} = -0.6\cdot 0.4 \frac{\ell ^ {0.75}}{ \ell ^ {1.4}}$$
Note the cross-partial is positive, which is how this economy still has increasing returns to scale:
$$ \frac{\partial y}{\partial \ell} \frac{\partial y}{\partial k} = 0.75 \cdot 0.6 \frac{1} { \ell ^ {0.25} \cdot k ^ {0.4}} > 0 $$
which is positive.
Both arguments show that the marginal product of the input decreases as the quantity of that input rises. This holds even though the production function shows increasing returns (and is actually homogeneous of degree 1.35).