This is all a complicated (and confusing, or just plain confused) way to say that, if you want the locomotive to pull the train, you don't want its wheels to slip. It's friction that prevents the wheels from slipping.
I suggest you simply delete this sentence:
This static frictional force, of the rails pushing forward on the wheels, is the only force that can accelerate the train, pull it uphill, or cancel out the force of air resistance while cruising at constant speed.
The paragraph makes a lot more sense without it. The author is trying to get at Newton's third law (equal and opposite reaction) but this way of putting it provides more confusion than insight.
The friction force does not have to be at its maximum, nor does it have to be equal to the component of the weight down the ramp (it actually can't be equal to this. See below.).
Let's set up the problem. You already have the free body diagram in your question, so I will not make a new one. Of course the forces balance out perpendicular to the ramp, which you already have:
$$N=mg\cos\theta$$
Parallel to the ramp we have, using Newton's second law:
$$\sum F_x=mg\sin\theta-F_f=ma$$
Also, using the Newton's second law for rotation we have
$$\sum \tau=RF_f=I\alpha=I\frac aR$$
Where we have assumed rolling without slipping, so $\alpha=\frac aR$. From here you will find that you don't actually need a value for the friction force to find the acceleration. I will leave this up to you to solve from here.$^*$
Shouldn't the magnitude of the frictional force be equal to the force with which the object is being pulled ?
This would mean that $mg\sin\theta=F_f$, so then $a=0$. But if $a=0$, then by our torque equation we must have $F_f=0$, which is a contradiction. Therefore, it is impossible for our static friction force to be equal to the component of the weight down the ramp. The rolling ball will always accelerate down the ramp, and so $F_f<mg\sin\theta$.
...they always assume the coefficient of static friction is maximum while deriving the equations or solving problems
This is not the correct way to do the problem. The way to do the problem is above, but let's explore this a bit more:
You can actually solve for $F_f$ here too by eliminating $a$ from the above equations. The result ends up being, if we want no slipping
$$F_f=\frac{mgI\sin\theta}{I+mR^2}\leq\mu mg\cos\theta$$
Therefore:
$$\tan\theta\leq\frac{I+mR^2}{I}\mu$$
If we have the special case where $I=\gamma mR^2$, then we have
$$\tan\theta\leq\frac{\gamma+1}{\gamma}\mu$$
We can compare this to a block on an incline, where the angle of no sipping is determined by $\tan\theta\leq\mu$, which is when $\gamma\gg1$ (i.e. an object that is very hard to roll, kind of like a block on an incline (the analogy is not perfect, so don't go too far into it)).
So we see here that the static friction force will not always be equal to the maximum static friction force. If we have our angle at exactly $\tan^{-1}\left(\frac{\gamma+1}{\gamma}\mu\right)$, then we can say the static friction force is at a maximum. Any angle past this will then produce rolling with slipping.
$^*$Note: This is the standard procedure for solving problems like these.
Best Answer
In your graph you have only plotted kinetic friction as a function of time and by the formula
$$F_k=\mu_kN$$
it remains constant because it is independent on the force(horizontal) you apply, surface area, time etc. however if you also include static friction in your graph it would have looked more like this:
Source: http://deutsch.physics.ucsc.edu/6A/book/forces/node21.html
From graph we can see:
Kinetic friction - remains constant
Static friction - increases and is equal to the force applied to remain in equilibrium until applied force is smaller than: $$F_s=\mu_sN$$
based on experimental observation it almost always turns out that static coefficient of friction is greater than kinetic coefficient of friction
$$\mu_s>\mu_k$$
Therefore the maximum force that we can apply on an object so that it can remain in equilibrium is greater than the force of kinetic friction which is constant, because of this we can observe that force of friction is decreasing when the object starts moving which is seen in the graph above colored in green.