It is known that both dinosaurs and crocodiles occur in the same stratigraphic sequence so that has to mean that they probably shared the same paleoenvioornment. Appreciate your thoughts on this question.
As pointed out by Mark, the co-occurrence of Crocodilian-Dinosaurian remains can be ascribed to Taphonomic factors. Dinosaurs were widely distributed from high to low latitudes in a variety of environmental settings with or without Crocodiles, but lived close to shallow marine, riverine and lake margins. It is also remarkable that along with a few other life forms, Crocodiles survived the Cretaceous-Paleogene mass extinction.
Dinosaurs with pure aquatic habitats could have only lived in association to crocodiles. Perhaps some amphibious dinosaurs could also have dwelled in the fresh-water and saline environments in close proximity to the crocodiles. In geological records, for sure their close association can be ascribed to taphonomic factors. Crocodiles should indeed be commended for surviving the K-T mass extinction which took a decisive toll on the very existence of the giant reptiles (dinosaurs).
The other thing to consider is that early crocodiles were not tied to water. They were much more diverse than today, and many were agile bipedal animals living in terrestrial environments. Even living crocs will sometimes cross large areas of dry land, I believe. Therefore, you can't really assume anything about the environment from the existence of crocodiles in the fauna. They're just not a good indicator. The invertebrate and sedimentary records will tell you a lot more about the environment of deposition.