There are some idiomatic uses around theater and film. For your sample sentence, I would say "There is a line in the movie Titanic...."
For another context, sometimes you might refer to an exact line by its reference, like "In Hamlet, Act II Scene 1, line 125..." This is most common when talking about Shakespeare's plays, but could also apply to other well known, published plays. (It's unlikely to be used of a movie's script since these are less often published in standardized print editions.)
The word "script" usually refers to the entire text of the entire dramatic work. If you said "There is a line in the script of Titanic," you might be calling attention to the written copy, like "There is a line in the script that never made it into the movie."
The word "line" is often used to mean "A brief quote from a dramatic work," as in "They love to quote lines from Monty Python and the Holy Grail. It could also mean "The amount that one character speaks, until the next character speaks." You have to be careful when discussing Shakespeare or other printed works, since it can also mean "The amount that is printed on one line of text, especially poetry."