It's also important to note that the Maxwell equations in fact are a relativistic field theory. Of course, Maxwell didn't know about relativity. It was however immediately clear that the Maxwell equations are not Galilei invariant.
At this time the physicists took this rather as a feature to solve the problem about how to determine physically absolute space and time and an inertial reference frame in the sense of Newtonian mechanics. Thus they took the Maxwell theory of electromagnetism as an opportunity to do so, i.e., they assumed that the electromagnetic waves and the dynamical electromagnetic fields, following as a simple consequence from Maxwell's equations, are in fact vibrational states of a medium (similar to water waves being vibrations of water as a fluid), called "the aether", and then the preferred inertial reference frame is the restframe of the unexcited aether.
The trouble, however, still was to establish a theory of electrodynamics in reference frames moving against the aether and thus "the electrodynamics of moving bodies". There were theories by H. Hertz and Lorentz's theory of electrons, and in the beginning they looked pretty promising. Today we know that these theories are correct as an approximation for relative motions to the aether at order ##v/c##, where ##c## is the light speed in a vacuum.
On the other hand it was pretty clear with the advent of experiments which were sensitive to phenomena at a precision of order ##(v/c)^2##. The most famous one is the Michelson Morely experiment to determine the "aether wind" due to the motion of the Earth around the Sun. From their point of view it seemed to be a complete failure, because they couldn't find any such effect though their apparatus for sure was able to reach this order-##(v/c)^2## accuracy. The conclusion thus was that there is no preferred frame of reference nor an aether, and several physicists thought about possible effects. One is the attempt by FitzGerald and Lorentz to save the aether theory by the assumption that lengths along the direction of the aether velocity shrink by a factor ##\sqrt{1-v^2/c^2}##. It was also known that Maxwell's equations are invariant under alternative transformations since the 1880ies, when Voigt found such a transformation, which is equivalent to the Lorentz transformation of special relativity, but this was taken rather as a mathematical curiosity first.
Famously it was Einstein who thought about the problem in a different way, i.e., he thought about the "asymmetries" that only occur in the interpretation of Maxwell's equations involving moving bodies, which are not apparent in the phenomena. That was a very new concept of thinking, namely the thinking in terms of symmetries. So Einstein came to the conclusion that one has to redefine the description of space and time such that the special principle of relativity is valid not only for mechanics but also for electrodynamics, and this lead him to special relativity. The math was already there (Lorentz, Poincare, FitzGerald, Heaviside), but the physical interpretation was entirely new, and the way of thinking in terms of symmetries has been the most successful concept for the development of the physics of the 20th century.
The result also is that there's no aether but that the electromagnetic field is itself a dynamical quantity as is matter, and all these dynamical entities are much better described in a theory which obeys the spacetime symmetry of special relativity (i.e., Minkowski space) rather than the Newtonian one.
The spacetime structure of Minkowski space changes the notion about the cause-and-effect relation of events as compared to Newtonian mechanics with its absolute time, and the consequence is that there's a "limiting speed", i.e., there cannot be causes by signals propagating faster than this limiting speed. Empirically it seems as if this limiting speed is indeed the speed of light, which occurs in the fundamental Maxwell equations of electromagnetism (in units which are not hiding their physical structure as unfortunately the SI units do), i.e., the speed of light in a vacuum. This is reflected by the retarded propagator of the d'Alembert operator, ##1/c^2 \partial_t^2-\Delta=\partial_{\mu} \partial^{\mu}## which describes the causal generation of electromagnetic waves by the charge-current distribution.
That was however refined only 10 years later in 1915, when Einstein after 10 years of struggle with a relativistic description of the gravitational interaction (at the same time as Hilbert) discovered general relativity, which is even more general: There are no more preferred types of reference frames, and the inertial frames are only choosable for a sufficiently small part of spacetime as particular frames, where the physical laws take the form of special relativity.