。
She ended up at the back of the line.
Literal
She [topic-は] line [possessive-の] very-end [at-に] ended-up-lining-up.
~てしまった marks an undesirable or regrettable completion — she didn't want to be at the back. 最後尾 (さいこうび) means 'the very end/tail' — a more specific word than 最後, emphasizing the extreme rear. 並ぶ (ならぶ, 'to line up') takes に for the position.