It's an interesting thought. Presumably, if you looked at the market capitalisation of some of the major commercial journal publishers, you could get a sense of how much it would cost to purchase both ownership of the intellectual property in such articles, journals, infrastructure and many other things.
I did a quick google and it suggested that the market capitalisation of Elsevier (for example http://www.bloomberg.com/quote/REL:LN) was 35 billion British Pounds (although I'm no expert in reading this stuff, and there seems like there is a lot of aggregation of companies into larger structures). My main point is that there is presumably a market value associated with the vast majority of the commercial publishing literature. It would be interesting to get an estimate of what this is (e.g., is it a half trillion US dollars or perhaps its much less, I'm not sure).
The main point is that it would be theoretically possible for governments to buy such companies or alternatively acquire the rights at commercial rates.
It would however be very expensive.
Alternatively, governments could change intellectual property law in relation to scientific journals or some category of material. There are a variety of ways that this could be done. A simple option would just be to mandate that articles in scientific journals need to be made accessible on a suitable repository (e.g., like pubmed) perhaps after some embargo period.
In general, a lot of this raises a number of broader legal issues. For example, it may be considered poor legal precedent to change the law after the fact. I.e., journals invested in publications on the assumption that their intellectual property would be protected and these rights are then unilaterally taken away by government. In some legal contexts, this may give rise to the publishers having rights for financial compensation.
The alternative strategy is to focus more on ways going forward that the published literature can be more accessible to the general public. For example, this can be seen in various conditions placed on grants that the publications need to be open.