If the world then already had the knowledge required, could an earlier variation of the steam engine be made during this timeline? If it could, how effective would it be for use in early locomotive?
As chasly has noted in their comment, "all the knowledge required" would absolutely enable you to do it at any point in history. However, it would require resources and manpower and so on...
The limiting factor on steam engine design before we got the really useful ones was materials. It's likely that people had worked out more effective steam engine designs earlier, because people knew why the early steam pump designs were wasteful and inefficient (though still sometimes worth using).
So, to take a more limited example, a time-travelling engineer could arrive back in the 14th-15th century knowing how to build a 19th century steam engine, but unless they also knew how to make 19th century steel (among other things), and how to build up the entire industrial pyramid the underlies that capability, they'd be a bit stuffed.
You could, with the materials available in those centuries, make a simple steam pump. You would be a bit ahead of time, historically, as far as I can tell - though there were steam pumps of a not-terribly useful sort much earlier. This could be used to drain water from a mine, but not as a practical means of locomotion.
If, however, the whole world, in one moment in the 14th-15th century, had the requisite knowledge just appear in their minds, of all different areas that would be necessary; or to a lesser extent if they received suddenly written explanations necessary to build up the knowledge, then they could fairly quickly catch up. Decades at most to get to the first engines useful for locomotion, given they would already have the designs for them. With the whole world working on it, building up the industrial pyramid would be quite easy.