I would say that technically yes, it's trespassing. However, some churches, might have a place where all are welcome to come pray, like a prayer garden.
If I went in an unlocked church to pray, I would see permission first.
There is nothing wrong with seeking the Lord in His house. But be respectful of it's caretakers.