It is true that a government loses revenue when it privatizes a function for which it used to collect money (like a toll road, for example). However, the government can make up for this because it no longer has to pay to staff and run that function. In addition, when the government privatizes a money-making function like a toll road (as opposed to one like a prison which does not bring in revenue) it can charge the private company for the right to take over that function.
When governments privatize things like toll roads (the government of Indiana has done this, for example), they sell the right to collect tolls. This gains revenue in the short term, although it of course gives up the right to the toll revenue in the long term.
In addition, the government is no longer responsible for paying to perform the function. It no longer has to pay the salaries of the people taking the tolls. It does not have to pay for things like upgrades to the toll system (like electronic toll-paying). These savings can also make up for the loss of revenue.
In these ways, governments often believe, they can make up for the loss of revenue when they privatize.