If a civilization finds an example of advanced technology, can they learn to duplicate the technology?
You have two variables:
The earlier "A" is, the more likely the answer is "No."
The greater "B" is, the more likely the answer is "No." (This is a necessary axiom of Clarkian Magic.)
As "A" advances, "B" can grow wider and the answer can still be a "Yes."
What is our year point of reference?
The Romans were technological marvels, but most of their advancement was in structural engineering. Had your example technology been anything involving electricity my instant answer would have been "absolutely not."
However, the Roman empire encompassed a large amount of time and a large amount of technological innovation. Just as my grandmother during her lifetime saw the horse-and-buggy and steam ships as the pinnacle of transportation technology give way to walking on the moon and air flight so common people don't dress up for it any more, the Romans shifted from their early years ("absolutely not") to 300ish AD when the answer becomes "possibly, maybe even probably."
An important date is 1 AD. That's when Hero of Alexandria created the Aeolipile. The Aeolipile was, basically, the first steam turbine. At this point they may not have had the other technological know-how to build a fully functioning 1800s steam engine... but they would have played with it for a while and, maybe, would have concluded, "you know, that looks an awful lot like a really complicated Aeolipile."
So far, I'm convinced that Romans from at least, say, 50 A.D. would have understood what they were looking at (after enough examination & experimentation) just as we have the ability to understand string theory without having the slightest idea how to prove it.
That leaves the question, could they duplicate it?
The components of a steam engine are improved with milling, but do not require milling. They can all be cast. The Romans knew how to do this, so they could build the shape of everything they need. That leaves metallurgical strength.
And that's where the last point I can make comes into play.
The Romans knew how to think
The ancient Romans knew how to figure things out. It would take time, because they're basically stuck with empirical research, but they could do it. Now the answer is "Yes, given enough time."
How much time do you need between when they found the engine and when you need them to duplicate the engine?
The following are all gut instinct and open to vociferous argument, but...
If the answer is found in 50 A.D., needed by 300 A.D., I'm willing to go out on a limb and say "Yes."
If the answer is found in 50 A.D., needed by 100 A.D., it's "very unlikely."
If the answer is found in 50 B.C., needed by anything less than 200 A.D., it's "probably no."
If the answer is found before 50 B.C., the answer is "impossible." There's not enough technological understanding in the Roman Empire to be capable of comprehending what they're looking at and by the time the Aeliopile came into being the example would be deteriorated or lost.
Some of the comments are wondering why the Romans would care to pursue steam engine technology. The OP hasn't told us the context of the future technology appearing in the past. If all that appeared was the engine, then it might be a hard sell unless someone was bright enough to think, "what if we hook this sucker up to a cart?" On the other hand, if what appeared was a working car... the Romans would be all over this technology considering the difficulties of their wide-spread empire. The real question is, what if it was a train engine? Something that needed tracks to be valuable? That's a whomping maybe because suddenly the infrastructure investment (laying rail) is enormous.
However, none of that is relevant as the OP didn't ask about it. It's the OP's problem to solve. If he hasn't, it's another question and not a valid answer to this one.
A number of commenters have expressed disbelief that reverse engineering can bring substantial value to the technological innovation process. Their premise is that the technologies didn't develop for a millennia or more on their own, which assumes they couldn't have developed in 200-300 years with a working example to experiment with or to motivate them.
Such commenters have no experience with reverse engineering. I do. Knowing that something is possible and you only need to duplicate it is much, much, much more powerful than not knowing something is possible and waiting around for the combination of imagination and scientific development to merge.
The simple truth is if the Romans were shown with irrefutable proof the value of a working steam engine, they wouldn't have one or two guys out there tinkering around with a vague idea (which is why it took millennia naturally). They'd have thousands and more people dedicated to realizing the military advantage. (Unless as previously indicated you want to choose that they don't see the value, in which case this is all a moot conversation. You won't invent what you don't care about.)
Some people like to think that innovation is somehow a fixed process, that it can't happen any faster than it did, but our own recent history in computer development has proven that wrong time and time again.
You need not understand why something works to duplicate it.
To conclude with an example, I wonder if some believe the specifications of an antique steam engine are as difficult to achieve as a 2017 combustion engine. Obviously, the metals and precision needed for a 2017 engine could not be duplicated by the romans during their time. But that isn't what was asked for. When I once read The Grapes of Wrath I noted a moment in the story when the family had to repair their engine. They'd lost compression, so they wrapped copper wire around the piston, shoved it back into the chamber, and off they went. I wondered about that and so asked my grandmother, who said things like that did, indeed, happen. That's an awful lot of imprecision to still have a working and useful engine.
If you still want to believe the Romans couldn't reverse engineer something as simple as a steam engine (with operating documents!) under the conditions I've specified, by all means, downvote my answer. I won't feel bad.