People often confuse a PFA with an order for Custody, although the two are different. If you have Temporary Legal Custody based on the PFA, it has no impact when the PFA expires. Further, the Court may not consider the time you had the children the same as in other considerations for custody.
So in short, yes the parents can take the children back. If there are still concerns for there safety, you will need to file a Complaint for Custody with the Court of Common Pleas. A Custody Order through this method has no expiration date.
Please know that the information I provide is general in nature as we do not have an attorney-client relationship, and thus do not have all the background information which would normally help me give a specific answer. However, if this answer has been helpful to you, please consider rating it with a "thumbs up". I wish you the best outcome with your situation!
Sign up to receive a 3-part series of useful information and advice about child custody law.