Answer:
The first sentence contains a simile while the second sentence has a metaphor.
Step-by-step explanation:
Simile and metaphor are figures of speech that compare different things to each other with the purpose of vividly describing a similar characteristic between them. The difference between both figures of speech is that the simile makes the comparison by using words such as "like" or "as". The metaphor, on the other hand, does not use such words. Study the examples below to better visualize the difference:
Simile: Your eyes are like stars.
Metaphor: Your eyes are stars.
In both of the sentences above, someone's eyes are being compared to stars, which probably means they are big and bright. However, the first sentence relies on the word "like" to establish the comparison, therefore constituting a simile. The second sentence does not, forming a metaphor.
Having that in mind:
"I felt as if invisible hands were holding me, and I made frantic efforts to free myself." - We have a simile here. The speaker uses "as if" to compare her feeling to hands holding her. She probably had a feeling of being restrained.
"My mother's only ray of hope came from Dickens's 'American Notes." - No one literally has a ray of hope. There is no such thing in the natural world. However, a ray is something the shines, that makes a dark place brighter. We can attribute such idea to the feeling of hope - it makes dark and difficult situations look brighter, better. Since there are no words such as "like" or "as", what we have here is a metaphor.