You need to understand the difference between invalidity and being illicit. To use an analogy, if a surgeon performs an operation that is illegal, or if he lacks a license, or the like, he performs surgery illicitly but still validly. If he puts a person under, cuts into them to create the appearance of having performed the operation, but does not actually perform the operation that he pretends to, then he performs surgery invalidly.
So, when the law declares that marriage is invalidates, it means that no marriage actually happens under the given circumstances. When the law simply prohibits marriage, it simply makes it illicit, but a marriage contracted illicitly is still a valid marriage.
As to the question you pose, the permission of the bishop is required for a Catholic to enter a marriage forbidden by civil law. However, if a priest celebrated such a marriage without permission, it would still be valid.
The state does have the right to regulate marriages among the unbaptized (since the Church has no authority over them), so marriages among the unbaptized would be invalid if they were invalid under civil law.
Current canon law defers to the law of non-Catholic Churches and ecclesial communities concerning the marriage laws which apply to their members. So the validity of a civilly invalid marriage among Protestants would be determined by whether their community had its own marriage law, or deferred to the civil law (as most Protestants do). However, this is a recent development, and was not the case before 1983. Prior to 1983, the validity of a Protestant marriage would have been governed by the same laws governing Catholic marriages, excluding the laws governing proper form.
I’m also not sure whether the prohibition on celebrating civilly prohibited marriages was part of pre-1983 canon law.
Tl;dr the state does not have a native right to regulate Christian marriage, so such marriages would have been valid when contracted among Christians, but would have been invalid when contracted among unbaptized persons.